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.
Tests should not print anything on success.
The tests should only compare values returned by
top
, and do everything explicitly, instead of relying on some hidden function.Node 12 should be enabled, and class syntax should be used.
These input/output has nothing to do with the task.
The tests are easily cheatable.
The same problem on LeetCode. Did you get permission to reproduce it here?
No random tests.
You could try writing a translation of the kata raulbc777 mentioned, there is small difference tho, the array size is fixed in the other kata.
There are some other problems with yours
It's a duplicate : https://www.codewars.com/kata/57f5e7bd60d0a0cfd900032d