1. You will be given an Integer array consisting of height of temples along a range of mountains
2. There is a devotee that wants to give atleast one offering to each of the temples
3. However, he/she has to follow a heirarchy for two adajacent temples:
a) temple with higher height must get more offerings than the one lower
b) if temples in question are at the same height, their relative offerings are irrelevant
4. Return minimum number of offerings
5. Input and output is handled for you
6. It is a functional problem ,please do not modify main()Input Format
Input is handled for you
Output Format
Output is handled for you
Constraints
1<=N<=10^6 1<=templeHeight<=10^3
Notice
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.Example
Input
11 10 47 5 91 57 8 11 93 11 8 6
Output
22