During the contest I used Array of Integer type to avoid TLE, which can occur with array of primitive ints but that led to wrong answer but after I tried with array of primitives and I got AC. Can someone tell me why this is happening?
Submission 1: WA (https://mirror.codeforces.com/contest/1592/submission/130698133)
Submission 2: AC (https://mirror.codeforces.com/contest/1592/submission/130727745)