Given a array arr = [1,2,4,2,1,7,2,3,5] Repeat it K-1 times. Say K = 3 so arr = [1,2,4,2,1,7,2,3,5,1,2,4,2,1,7,2,3,5]
Now given L and R give the number whose occurance is maximum between L abd R index of arr including L and R, if more than such occurance return minimum value.
Ex: L= 2 and R = 5
arr = [2,4,2,1]
Answer is 2 since it repeats maximum times.
Input is arr, k, L and R.