Ad
  • Custom User Avatar

    Oh! Interesting, I'll try them.
    And yeah, division looks like a tricky problem, but I already have some ideas to get them working.
    And after solving all of these 4 basic operations, I will actually try making the "ultimate" operations kata in BF: evaluating mathematical expression containing some numbers and operations and maybe parentheses for calculation priorities!

  • Custom User Avatar

    Lol, you were lucky! GG!
    I had originally planned on having something like 2 times more tests, but my code was bearly making it, so I actually reduced the amount of tests enough so my code could pass them without that much difficulty, but 8 milliseconds of the timeout is insane lol!

  • Custom User Avatar

    It took me quite some time to understand how to do if correctly in BF. Then I did Test Driven Bogo Coding until I arrived here.

  • Custom User Avatar

    It's also a game/challenge, and these are all good opportunities to learn different methods to do things. And in a production environment might not have the option to change language but can still make the code run faster where and how we can.

  • Custom User Avatar

    If I was worrying about the cost of operations like division, I wouldn't be using Python.

  • Custom User Avatar

    If you know what format the temperature is coming in already, you can just check it against the type to convert to. There is no such thing as "both". It is one or the other. Whenever you use both, the calculation for the same type of temperature will always be wrong (input fahrenheit, convert with "both", output fahrenheit will be different because it was treated as celcius).

    EDIT: Ok, I see - it is tested upon and expected to work that way. Still a dumb idea. One will always be wrong, why bother.

  • Custom User Avatar

    You are right. I couldn't think of a way to make the previous any faster or more concise :-(

  • Custom User Avatar

    Never put links directly to /train pages.

  • Custom User Avatar

    O(n^2) is a time complxity (e.g., quadratic time). Recursive calculations of Fibonacci numbers use O(n^2) time complexity.