My code is running and showing correct output in my IDE but when i submit on Codechef, it shows wrong answer. Can somebody help me out to identify what is wrong in my code and how can it correct it?
I don’t think so this would be the problem because i didn’t increment “i” so it will automatically take the value a[i] in next step.
Though i tried running after making the specified changes, it didn’t even pass the sample test cases.