We are given an array of integers and a range, we need to find whether the subarray which falls in this range has values in the form of a mountain…

We are given an array of integers and a range, we need to find whether the subarray which falls in this range has values in the form of a mountain or not. All values of the subarray are said to be in the form of a mountain if either all values are increasing or decreasing or first increasing and then decreasing. Write a C/C++ Program that shows input is a Mountain sequence or Not Mountain sequence.

From the Combined Bank Assistant Programmer (CSE) March 2021 – Preliminary exam, question 80 of 86.

More from this paper