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.
I think push/pop are correct in a Stack (LIFO). Unshift/pop would be FIFO which (Queue)
Well, push and pop are faster and much more efficient in comparison to unshift and shift I believe.
I don't quite understand what you mean, you mean if obj[el] is non-existent, delete obj[el]?
But the question is we need to find out the odd one, not only the only one.
If you call variable as a stack you should use .unshift instead of push. Because stack involves the principle of first came, the latter came out.
not enought good because two loops instead of one. One loop is enought (use
delete
instead of= 1
and then get the only object field).