I was not able to get O(n) solution for it. please help me with approach to solution
Example:- array- [2,3,2,1]
constraints:- 1<=n<= 8*10^5 1<= power[i]<= 10^5