LightHouse1's blog

By LightHouse1, history, 2 years ago, In English

In C++,we can use std:map which prevents hash collision. What is the way out in python?

  • Vote: I like it
  • +6
  • Vote: I do not like it

| Write comment?
»
18 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

A solution that I found was that instead of having the keys in your dictionary as integers make them as strings, that reduced the density of integers at a particular place, which was originally leading to TLE