I have an unsorted set of integers and an interval length. I need to find the largest subset of elements included in a given interval
Example 1:
Set: [11, 1, 2, 100, 12, 14, 99]
Interval: 4
Result: [11, 12, 14]
Example 2:
Set: [1, 100, 55, 2, 88, 3]
Interval: 10
Result: [1, 2, 3]
In practice, there are many more elements in the set
What is the efficient data structure and algorithm for solving this problem?