Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Because the sum of each weight is 2, and then you have to sort lexiographicaly. And 11 comes before 2000.
Strange task. I still do not understand about ([1,3,4,5], 2)
you can't form a group of 2 elements with 1 (since 2 is not present in the list).
Your code is wrong as it replaces all the letters in inputs and return the last result.
Change to Node 8. and it should work. The curent JS framework has not been updated in most katas, apologies for the inconvenience causedIt's actually still working (I've tested it) , please post your code with spoiler to figure out the real problem.
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.
Your return statement is at the wrong place ;-)