bursty's blog

By bursty, history, 5 years ago, In English

154369620 I need help to figure out why this solution gave TLE. Thanks!

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

154484109 Changed unordered_map to map in your code and it works

Reason : unordered_map in worst case takes O(n) search time if there are n elements in it ( Due to collisions in hashing )