Ad
  • Custom User Avatar

    updated Ruby translation -- please check and approve

  • Custom User Avatar

    Ruby submit tests seem to be broken at least as far as error reporting goes.

    With this (trivially wrong) solution:

    def twoSum(numbers, target)
      [1,2]
    end
    

    I get

     should work for the following
    Log
    [340, 538, 868, 385, 197, 175, 447, 249, 678, 773], 832
    Expected: 1406, instead got: 832
    

    832 matches the target, if it's the target printed in the log, we don't know.., but even that should not be the expected value, that should be an index pair. 1406 seems to be the sum this solution gets.

  • Custom User Avatar

    Fair enough, point taken. Thanks.

  • Default User Avatar

    @wthit56, C and Java translations ready.

  • Custom User Avatar

    "Input is valid" means input is array, array is in correct length and the values in the array is valid. It does not mean there are no extra properties.

    If your code would break because of extra properties unrelated to everything else, maybe you need to use better practices ;-)

  • Custom User Avatar

    Are you using for ... in? The prop is not inside the array, it's added to it, the items inside the array are all numbers.
    I guess it's there to teach you not to use it with arrays.

  • Custom User Avatar

    Something very odd about this kata

    all but one test passed, the failed test gives the error -
    [ 0, 1, 2, prop: 3 ] 3 Array with added property - Expected: '[1, 2]', instead got: '[0, NaN]'

    yet in the instructions it clearly states

    The input will always be valid (numbers will be an array of length 2 or greater, and all of the items will be numbers...

    so what the hell is prop: 3 and why is it in the array?