Wrong answer even if o(n) soln

tle is coming but i don’t think o(n) will make tle

Hey @abhishekvr12 you need to use fast i/o along with your O(n) solution to pass the time limit constraint.
Add this to your main function and then your O(n) solution should work fine.
ios_base::sync_with_stdio(false);
cin.tie(NULL);

Hey @abhishekvr12 mark the doubt as resolved if you don’t have any further queries.