- 1of 1 vote
You are given an array A with n elements. You are given S, E and H array with each M elements.
Apply an operation such that all the elements from A[ S[i] ] and A[ E[i] ] will be less than H[i].
given array A = [2,4,8,6,7]
S = 1
E = 4
H = 5
So, after doing an operation, the resulting array is A = [ 2,4,5,5,5]
Thus, u need to do the same thing for all i.
After doing this, find out the maximum element in the array.