start += direction
return start

def destruct_single_run(num_set):
    arbitrary_member = next(iter(num_set))
bottom = destruct_directed_run(num_set, arbitrary_member, -1)
top = destruct_directed_run(num_set, arbitrary_member + 1, 1)
return list(range(bottom + 1, top))

def max_run(data_set):
    nums = set(data_set)
best_run = []
while nums:
    cur_run = destruct_single_run(nums)
if len(cur_run) > len(best_run):
    best_run = cur_run
return best_run

def test_max_run(data_set, expected):
    actual = max_run(data_set)
print(data_set, actual, expected, 'Pass' if expected == actual else 'Fail')
print(test_max_run([10, 21, 45, 22, 7, 2, 67, 19, 13, 45, 12, 11, 18, 16, 
    17, 100, 201, 20, 101], list(range(16, 23))))
print(test_max_run([1, 2, 3], list(range(1, 4))))
print(max_run([1, 3, 5]), 'any singleton output fine')
Longest Consecutive Sequence in an Unsorted Array