4 votes
Accepted

Finding missing numbers in ranges

The primary problem with your current approach. As you know from previous answers and comments, the limitation of your current approach is that it falters when faced with very large intervals, which ...
FMc's user avatar
  • 12.5k
2 votes
Accepted

Given a sorted list of integers, find the highest count of elements between an indeterminate but fixed size range

Inappropriate use of iteration functions Complexity When the data is sorted it is a sure sign that there is a solution with less complexity than \$O(n^2)\$ The use of 'Array.reduce' and ...
Blindman67's user avatar
  • 21.6k
1 vote

Given a sorted list of integers, find the highest count of elements between an indeterminate but fixed size range

I'd establish a base line implementation for correctness tests and performance using the most simple approach to conceivably do. (For me, that would be initialising a start of range to start of list ...
greybeard's user avatar
  • 6,104
1 vote

Finding missing numbers in ranges

I like the fact that you thought to use a set for your current approach. That is typically the right data structure for "Have I seen this before?" type questions, and is actually doing a lot ...
Josiah's user avatar
  • 5,966
1 vote

Finding missing numbers in ranges

I think the complicating factor here is that most of these operations on individual intervals can return multiple intervals back to you, which can be tricky to work with. I'd probably start by ...
OnceAndFutureKing's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible