Let's agree Hackerrank sucks.
Develop a shity solution in a very limited time, using ES5 and no libraries for JS, waste time parsing your input where the first element means nothing and the other must have the type converted several times....
If you really want to test a candidate, give them unlimited time, a "real problem" and something that they don't know.