Ad
  • Custom User Avatar

    think there's a bug in your random 'submit' test, i run on this array :

    [-13,-58,-99,-77,-75,-96,-71,-53,-37]

    and it was expecting to have a result of 62

  • Custom User Avatar

    most of the solutions (mine included) would fail if they tried "up" first because of the last test having mulitple possible path (the 'up' first would be a valid but longer path than expected solution).
    should add some test case in the same spirit for defeating all solution that relies on trying the same direction first.

  • Custom User Avatar

    realizing i should have simply used a function like

    function reverseArg(fn) {
      return function(){
       return fn.apply(this, slice(arguments).reverse())
      }
    }
    

    and declares add/sub/mult/div's arguments in regular order