+ 1

[SOLVED] C# Password Validation : Test #4

Hi everyone, first post here ! I just finished C# courses and was doing some of the CodeCoaches but I'm stuck on Password Validation. I've got evey test checked except the 4th one which is locked. Here is my code : https://sololearn.com/compiler-playground/clIjIsDBeQVj/?ref=app If you have any Idea if what's the problem or another way to do it, I'm all ears !

2nd May 2024, 10:39 PM
MCfrn
3 Antworten
+ 7
Manuel Canfran there is a minor logic error. When a short password is entered (<7 characters) the code prints Weak Weak That is twice, whereas it should print once. The code passes all tests after this little bug is fixed.
3rd May 2024, 6:19 AM
Brian
Brian - avatar
+ 5
Though this is a code coach problem, better to suggest you tips instead of answer. You uses nested loops to iterate over the characters and special characters, making it less efficient. It converts each character to a string for digit checking, which is unnecessary. Also there are few mistakes check patiently.
3rd May 2024, 2:49 AM
`ᴴᵗᵗየ
`ᴴᵗᵗየ - avatar
+ 2
Thanks to the both of you ! I'll change this and try to make it more efficient !
3rd May 2024, 6:54 AM
MCfrn