Ad
  • Custom User Avatar

    The kata descripton is not complete.
    The most popular/proper solution loses tail params if remaining arg.length is less than needed for the next function

    //   fn1    fn2         fn3
    fn = x1 => (x2, x3) => (x4, x5, x6) => ...
    uncurry(fn)( 1, 2, 3, 4, 5 )
    //           x1 x2 x3 x4 x5
    

    In this case arguments 4, 5 will be lost, because fn3 will be returned (and not called).

    To pass all the test I firstly tweaked my solution so the fn3 would be called with remaining args like (4, 5) (what may break fn3).
    But I think it is still better than dropping any arguments.
    In my last solution I bind remaining args and return partially applied fn3.

  • Default User Avatar
  • Default User Avatar

    You mean the word distinct?
    Got me too, and now I have the solution which works for [3,3,3,3,3,3]