Longest sequence whose neighbours differ by less than k

0
Remix

A variant of longest consecutive sequence: from the values in an array, find the longest sequence in which each neighbouring pair differs by less than k.

AmazonTechnical phone screenLast asked Apr 2026
No answer yet. Write the first one; the best answer gets endorsed.