showing TLE in last two cases
Https://ide.codingblocks.com/s/259274
Hi Navpreet. Please use unordered_map because its runtime is O(1) that is constant time. You have used map which adds a logn factor due to its sorting nature and hence your overall time complexity becomes O(nlogn) and it will only pass when time complexity is O(n).
Please provide a proper link. This link seems to be broken.
I also think that u should reduce long long int to long int because hashing long long int may take more time than hashing long int. After this it might work.