Ad
  • Default User Avatar

    Because the sum of each weight is 2, and then you have to sort lexiographicaly. And 11 comes before 2000.

  • Default User Avatar

    Strange task. I still do not understand about ([1,3,4,5], 2)

  • Default User Avatar

    you can't form a group of 2 elements with 1 (since 2 is not present in the list).

  • Custom User Avatar

    Your code is wrong as it replaces all the letters in inputs and return the last result.

  • Custom User Avatar

    Change to Node 8. and it should work. The curent JS framework has not been updated in most katas, apologies for the inconvenience caused

    It's actually still working (I've tested it) , please post your code with spoiler to figure out the real problem.

  • Default User Avatar

    Your while statement isnt behaving as you think. As soon as it enters the while loop it returns 's'. The code following it never executes. return breaks any loop or code execution and will return the value, in this case 's'. It always returns the first three elements because you return the first three elements before any operation in conducted. Furthermore, you should consider completing operations on the list and not loading it into separate variables(n1, n2 n3). From a memory standpoint this is inefficient and IMO is messier than just completing operations on the list itself. These operations can be done on the passed in list itself.

  • Custom User Avatar

    Your return statement is at the wrong place ;-)