Ad
  • Default User Avatar

    There is a bug in your code because I proved it in a totally different language.

    @jahironr Please don't spread such foolishness...

    There is no error in your code. Error is in test function which generates floats.
    As andreydenisov said, you can "correct" your code by converting inputs to integers or you can use integer division \\ instead of classic division \.

  • Default User Avatar

    Theres a bug in your code, because I proved it in Javascript and had an error. Expected: 60, Got: 80.53.

  • Default User Avatar

    Try adding

    n = int(n)
    m = int(m)
    

    in the beginning of your function. Solved the problem for me.