Ad
  • 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

  • Default User Avatar

    Please reread the instructions. You are looking for the number which is not like all the other numbers in the string in terms of evenness or oddness. In other words you are looking for the single odd number or the single even number.

    eg:
    iqTest("1 2 1 1") => 2 // Second number is even, while the rest of the numbers are odd

  • Loading more items...