+ 11
Can someone explain why my test cases are failing?
Here is the problem.. https://www.codechef.com/COOK126C/problems/PASSWD And here's my attempt https://code.sololearn.com/cniLL3pYTYET/?ref=app
7 Respuestas
+ 7
Yes it runs on individual trials but when I run with 3 test cases..it fails like
Test cases
3
#cookOff#P1
U@code4CHEFINA
gR3@tPWD --this case is failing
My Output
No
Yes
Yes
Expected Output
No
Yes
No
+ 7
I appreciate your help!
But something isn't working as per the constraints idk though..
+ 6
No bro.. you are changing the results..and that's not I'm looking for..
Thanks anyways
+ 5
what the problem with your code?
it prints 'No' for 'gR3@tPWD' which is correct.
on the codechef page it's said that you have to print 'YES' or 'NO'.
+ 3
add on line 6
sc.nextLine();
this will consume the residual '\n' produced by h=sc.nextInt;
and your regex are not correct, they match even invalid password.
+ 2
+ 1
I read the description on the codechef page, it's said there that a valid password should not start or end with a capital letter.
so I think there is an error in the execution example they gave, concerning 'U@code4CHEFINA' which should not be valid.
if you want to ignore this condition, just remove the line 27 of my code.