Ad
  • Default User Avatar

    Click on Show Variations! There is multiline version.

  • Default User Avatar

    It could work as long as you call it with exactly 3 parameters. The problem is when you call it with different number of parameters. In those case (a, b, c) version will raise an ArgumentError because the function requiers exactly 3 parameter. Your soultion will raise nil related errors if you call it less then 3 parameters, which is misleading, but it will NOT raise any error in the case of more then 3 parameters. And this latter means it may hide a coding error.

  • Default User Avatar

    I think accessing value in hash is O(log(n)) so the entire function is O(n * log(n)). Anyway, thanks & you're welcome.

  • Default User Avatar

    It seems the test6..8 are missing from the C# version. I've got tis result when submitting a solution with simply converting the params to Int32:

    CodeWarsTest
    Test1
    Test Passed
    Test2
    Test Passed
    Test3
    Test Passed
    Test4
    Test Passed
    Test5
    Test Passed
    Test6
    Test7
    Test8
    5 Passed
    0 Failed
    0 Errors
    

    I guess those missing cases are for the big integers. So without them this kata is far from 4 kyu rather 7 or 8.