Check for Valid Mountain in Array

Check if Array form Valid Mountain or not

Given an integer array, your task is to check if elements in array form Valid Mountain or not. If yes then return True else False. That means elements should be in strictly increasing order up to some instances after that in strictly non-decreasing order. Hopefully, the following figure clear your idea!


Now let's see this in action:


Thank you so much for reading this article, if you like this question please share this with your friends who love programming. And if you have questions or feedback please drop a comment.

To solve more problems please check out this article "Top 10 Array Interview Questions".

All the Best!

Comments

Popular posts from this blog

Four Sum Problem (4sum) Solution in Java, Python, C++

Find the length of the longest substring without repeating character

Reverse Words in a Sentence Without using any Library