An array is a mountain if there is an index i (not at either end) such that values strictly increase up to i and strictly decrease after it. Given nums, return the minimum number of elements to remove so the remaining array is a mountain. The input is JSON {nums}.
Input: JSON {nums}.
Output: Integer — the minimum removals.
Input: {"nums":[1,3,1]}
Output: 0
Explanation: Already a mountain.Input: {"nums":[2,1,1,5,6,2,3,1]}
Output: 3
Explanation: Remove three to form a mountain.Input: {"nums":[9,8,1,7,6,5,4,3,2,1]}
Output: 2
Explanation: Trim to a valid mountain.3<=n<=1000