Finding the longest run of consecutive integers without sorting separates candidates who reach for O(n log n) from those who see the hash-set trick. The signal is one loop invariant that kills redundant work. Here is the answer.
Unlock the other 750 answers · ₹2,000 / $25Your progress and mastery stay saved · 6 months · one payment · no auto-renew
