In order to find : A = [ min (x i,x j) ] ⋅ ( j− i ) where j>i and i,j≤n

for every index of a[o], we have to check for all the elements of indexes a[1] to a[n.]

for next index of a[1], I have to check for all the elements of indexes a[2] to a[n]

similarly it will take O(N^2) time to do this. then after doing this.

O(N) time for finding maximum values in all the values of A.

so, i think O(n^2) will be complexity...

for every index of a[o], we have to check for all the elements of indexes a[1] to a[n.]

for next index of a[1], I have to check for all the elements of indexes a[2] to a[n]

similarly it will take O(N^2) time to do this. then after doing this.

O(N) time for finding maximum values in all the values of A.

so, i think O(n^2) will be complexity...