Longest sequence whose neighbours differ by less than k
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.
No answer yet. Write the first one; the best answer gets endorsed.
