This is my solution when I used unordered_map.
This is my solution when I used ordered_map.
It is seen that unordered_map performs better than ordered_map so how can TLE get resolved with ordered_map but not with unordered_map???
Full text and comments »