yarn
yarn start INPUT
example:
yarn start "1-5, 2-10, 1-10"
yarn test
or yarn test:watch
- Parse has O(n)
- Merge would be O(n), but JS sort has O(log(n)).
So overall the solution is O(log(n))
The final array cannot grow from the initial, only shrink. It has O(n) spacial complexity.