Ad
  • Custom User Avatar

    Why for number 9007199254739993 function should return false and for number 9007199254740991 number? They both save 53 bits numbers

  • Custom User Avatar

    "So, as long as the integers and their sum are never larger than 53 bits in magnitude..." "a and b will always be valid integers." , so a and b they always safe or not?

  • Custom User Avatar

    As future reference, functions returning mixed types (boolean/number) is generally considered an antipattern.

  • Custom User Avatar
    a and b will always be valid integers.

    That was not the case, maybe you need to edit the discription a bit. User have to check if inputs are still safe.

  • Default User Avatar

    I got the same error because i was attempting to print the arr while testing my solution. Once I removed the print the kata worked without issue.

  • Custom User Avatar

    That's looking much better.

    As a minor point, there are three conditions that can lead to a false result, and you're probably testing only one of them with these test cases. (a+b, and not a or b individually.) For completeness, the random tests should probably have possibilities for any and all of a, b and a+b to be out of bounds, or not. But for a 7kyu kata, this should suffice to weed out the likes of Hacker Sakana and me. :]

    Thanks!

  • Default User Avatar

    Thanks, I think I fixed the random tests.

  • Custom User Avatar

    This is not the way to do random tests. The answer has to be random, not just the arguments. Run random arguments through a reference solution and compare the user answer to that answer, don't just pick random arguments that lead to a predictable answer anyway.

  • Default User Avatar

    I see a test where r=6 and the answer is Sheldon, as expected. Not sure where you are seeing what you are seeing. I solved in JavaScript, maybe there is an error in a different language.

  • Default User Avatar

    "IIV" is correct roman numeral format. To represet three you would use "III"

  • Default User Avatar

    Its wrong.
    solution("IIV") return 2 instead of 3.

  • Default User Avatar

    It's about time that I learn how to deal with big integers in Javascript. Can anybody point me in the right direction for learning the best way?

    I'm not asking anyone to solve this for me, just point me in the right general direction for learning how to deal with very large numbers in Javascript.

  • Default User Avatar

    Added a three random test cases.

  • Default User Avatar

    Needs random test cases

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...