Why is this approach failing?
This solution fails the second testcase and I don't understand why since the logic that I have used here seems to be fine. Any help would be appreciated.
Atcoder ABC #354 Solution Discussion