Longest subarray with distinct elements

easy