My answer was accepted. However, I know that my code has at least two serious problems:
- I used "==" to compare potentially floating point numbers
- I used floating point number as hash keys
Shouldn't such code lead to incorrect results? Or Python is just so good that using floating point numbers as hash key is a no issue? If it's the latter, does anyone know how Python handles hashing floating point numbers without running into the thorny floating point errors?
i don't use float, All is integer.my program takes 88ms