To those C++ TLE Guys

  • 0

    Change your maps to unordered_map, it might solve the problem. The reason is that unordered_map is internally a hash map. O(1) is always faster than O(log(n)).

  • 0

    Thanks for the advice. But still got TLE with unordered map in my case.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.