Editorial Code doesnt work properly


#1

A simple test case :
1 aaa
should have output 1 since we get the same string at time 1 itself.
Even expected output has output 1 but the editorial code gives output 2.
You can try out yourself.