+2

Password validation

Didn't pass, test 13 and 14, anyone can help me? https://code.sololearn.com/cFhDsw8xC650/?ref=app

2/20/2020 5:58:49 AM

Arthur Barbosa

5 Answers

New Answer

+3

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.

+2

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

+2

https://code.sololearn.com/cmTDJe4xX9vu/?ref=app

0

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.