Longest Subset With Consecutive Numbers

Given a set of numbers, find the longest subset of consecutive numbers.

Example:
Input:
1 3 8 14 4 10 2 11
Output:
1 2 3 4


Please try solving this problem before jumping on the solution

Click to learn






Subscribe for more updates



Preparing for interviews? IDeserve team is here to help.




Algorithm/Insights

Please watch the video for explanation.


Hone your coding skills!




AngryNerds Practice platform »

Contribution

  • Sincere thanks from IDeserve community to Virendra Karappa for compiling current post.

    Virendra Karappa

    Ninja Programmer