Given an array arr[] consisting of N integers, the task is to find the largest subarray consisting of unique elements only.
Examples:
Input:_ arr[] = {1, 2, 3, 4, 5, 1, 2, 3}_
Output:_ 5_
Explanation:_ One possible subarray is {1, 2, 3, 4, 5}._
Input:_ arr[]={1, 2, 4, 4, 5, 6, 7, 8, 3, 4, 5, 3, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4}_
Output:_ 8_
Explanation:_ Only possible subarray is {3, 4, 5, 6, 7, 8, 1, 2}._
#arrays #greedy #hash #searching #frequency-counting #java-hashmap #subarray