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.
Very good!
It's an O(n) solution, pushing them into the array
Yours is less lines of code but the duplicate check is an O(n^2) search.
Man... What is it?
You can write 'while (n)' instead of 'while (n > 0)', cause when n == 0 - fasle