Given an array, find the largest subarray that contains consecutive elements (by value).
Treat the values as reorderable, so a valid subarray may not be sorted, but it must contain distinct integers with no gaps. Return the inclusive [start, end] indices of the longest valid subarray; if multiple subarrays tie, return the one with the smallest starting index. Assume the array is non-empty.
def longest_consecutive_subarray(nums):