0

I don't know whats the error is please help me

https://code.sololearn.com/cigzSSTzyOAK/?ref=app the program runs nicely until I give the input Password12#$, the expected output for the given input is 'Strong' but my output is 'Weak' I don't know why please help me

16th Oct 2021, 3:18 AM
No Mercy
No Mercy - avatar
2 Answers
+ 2
Password12#$ 012345678901 length is 12 $ is 11 for(int i=0; i < password.length-1; ++i) 11 < 12 - 1 11 < 11 false last char in pasword is ignored
16th Oct 2021, 4:04 AM
zemiak
+ 1
for loop is not iterating complete list. correct length in both for loops as below. i<password.length a<password.length Note: Try to avoid number of "for loops" to reduce the time complexity of the code.
16th Oct 2021, 4:07 AM
Sushil đŸ›Ąïž
Sushil đŸ›Ąïž - avatar