My code for WEIRDO is giving TLE for short test cases and it passes long test cases. I couldn’t find the reason for it.
Can anyone help me with this?
Link to the problem: Problem
Any test cases where my code is failing or bug will be a great help.
Edit1: I tried with changing map to unordered_map and with sorting it is still the same. Link: Updated code