I am solving below problem, and I wrote a solution for the same. I can't understand on which test case or why/where it is giving runtime error. I tried very hard to debug this, but could not understand. I checked other's accepted solution for getting a test case on which my solution could fail, but still couldn't get such test case. Can someone please help me with this ? Any help will be appreciated. Thanks in advance.
Problem Link: https://codeforces.com/problemset/problem/1551/C
My solution: https://codeforces.com/contest/1551/submission/124854239 ( giving run time error on test case #2 )
Note: Also, please don't downvote if you can't help, I really tried very hard to debug my code.
UPD: I caught the issue, it is inside my comparator function. Never mind. Thanks