Different outputs while testing and submitting


#1

I am getting different output while submitting. When I run it as custom input, the output matches with the expected output. Does someone know where can the mistake be?


#2

Generally, this happens when you make use of global variables. Don’t forget to clear them before each run, else they take random values.