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.
Uncomment that code, and add a condition that when
lst.length == 0
, return[]
Because:
(And these were causing your code to time out)
Got it?
Call your function like this:
arrayDiff([1,2,2], [2])
and see what happens. When you mutate the first array that you're using in the loop, your code skip some values.Use something like this: http://pythontutor.com/javascript.html to see what your code does.