Pattern Mountains

https://online.codingblocks.com/player/15114/content/7536/4782

I am not able to solve this problem?can anyone explain it’s loggic.