+ 9
[SOLVED] Password Validation (Swift) Code Coach Problem
I am getting 6/13 test cases failed. Why?? What's wrong?? Question https://www.sololearn.com/coach/76?ref=app My Solution https://code.sololearn.com/c85zoCtmG0D6/?ref=app
3 Antworten
+ 15
First of all read inputs
var inputS = readLine()!
Good check
if inputArr.count < 7 {
result = false
}
Here use && (and) not || (or)
if result {
if resNumbers > 1 && resSpecial > 1 {
result = true
}/*if not meet re assign result or it will be same (true)*/
else{result = false}
}
+ 6
Thank you so much ᮴Ridwan it is solved now ☺️😊☺️😊
+ 1
The problem requires that both, numbers AND special characters occur at least in the specified number. You check if either one or the other condition is fulfilled.