Python 3 code to find longest subarray with difference between max and min as at - most 1.
def longestSubarray ( input , length ) : NEW_LINE INDENT prev = - 1 NEW_LINE prevCount = 0 NEW_LINE currentCount = 1 NEW_LINE DEDENT