Insufficient test cases?


  • 0
    D

    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?


  • 0
    C

    i don't use float, All is integer.my program takes 88ms


  • 0
    D

    Thanks, CharellkingQu! May I know how you represent an arbitrary radius with integer? Or you have some way to work around the problem of calculating the tangent of a line?


Log in to reply
 

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