vishudon's blog

By vishudon, history, 10 months ago, In English


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:

My solution: ( 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

  • Vote: I like it
  • -1
  • Vote: I do not like it