binary search: edge case
binary search: edge case: a task in smol-software-harbor (Harbor dataset). insertionIndex() in lib/sorted.js returns wrong positions at the edges: inserting into an empty array, before the first element, after the last one, and after a run of equal elements (it must go after them, so equal items…
The task
`insertionIndex()` in `lib/sorted.js` returns wrong positions at the edges: inserting into an empty array, before the first element, after the last one, and after a run of equal elements (it must go after them, so equal items keep their insertion order). Fix the binary search and run `node --test test/*.test.js`.
Part of efederici/smol-software-harbor.