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
Loading collection data...
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