for example if array A is [5,6,5,10,15,2,10,19,2,11,19], then the answer is (1,5), there may be more than one such sub array, but you should return any one of them
Longest subarray with with All distict elements

This is the same as Longest Substring Without Repeating Characters, one solution is to use two pointers (slow and fast) and a hash set to track the longest substring without repeating characters so far. Time complexity is O(n).