You are viewing a single comment's thread. Return to all comments →
I encountered same issue, but it was only because the input test cases.
I solved it by converting the each element to integer
let ary = str.split("\n")[1].split(' ').map(function(item) { return parseInt(item, 10); })
or simply use someArry.map(Number)
Seems like cookies are disabled on this browser, please enable them to open this website
Insertion Sort - Part 1
You are viewing a single comment's thread. Return to all comments →
I encountered same issue, but it was only because the input test cases.
I solved it by converting the each element to integer
let ary = str.split("\n")[1].split(' ').map(function(item) { return parseInt(item, 10); })
or simply use someArry.map(Number)