I am getting correct output when I run using custom input i.e.
but I am getting Wrong answer while submitting. Judge says code returns
while the expected output is
I think there is a conflict with global variable, Can you please check what the issue is?