Shows "Wrong answer" incorrectly


Wrong Answer. Your program’s output doesn’t match the expected output. You can try testing your code with custom input and try putting debug statements in your code.

Your submission failed for the following input:

A : [ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaa", "aa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aa" ]

Your function returned the following :


The expected returned value :



Same here. If u have found the answer then please let me know


same here, if you got ans plz let me too know


Problem might be in the if statement while ending the loop if you try to access the element above the array size these kind of errors are occuring
in this example you may have accessed 3rd element in aa string which gives you ans but as it was outbound its showing as wrong ans.