Can anyone rectify my code? I am getting an NZEC however I have tried all the testcases(available along with the problem and a few mentioned in the comments) with correct outputs. If my code looks extremely complicated and confusing,well I’m sorry for that.
the problem is that you are taking input string after a line is left…which should not be the case…the input has to be taken in the very next line on the input og N!!!
For your code this input:-
3
ABCD
gives NZEC…!!!
you dont need to take input like this:-
3
//this empty line does not exist in the input file!!!!
ABCD
still to be on the safer side…for ne empty lines in the input file u can use this…