Password validation | SoloLearn: Learn to code for FREE!


Password validation

Didn't pass, test 13 and 14, anyone can help me?

2/20/2020 5:58:49 AM

Arthur Barbosa

5 Answers

New Answer


no need to use set() on the findall result of symbol, it will reduce the actual number of symbol. for example, aabb22!! will be counted weak while it is actually strong. another chance of improvement is that, instead of using nested if, use and to combine the three condition into one if.



The problem was the set()! Thanks everybody for the answers! Tibor Santa Gordon WhyFry


It seems SL has added more test cases, my old solution did not work on this one either and failed the same tests. I was also using sets in my solution. The task demands to have at least 2 special characters in the password, but in fact they can be the same special character. So something like hell$w$rld99 should be valid. Review how you use sets because they eliminate duplicates.