Back
Close
  • 80

Learning Opportunities

This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.

Statement

 Goal

The task here is to print the ASCII representation of n mountains where the height of each mountain is given.
Input
Line 1: an integer n for the number of mountains
Line 2: n space-separated integers for the height of each mountain
Output
An ASCII representation of the mountain where each rise in the mountain is represented by '/' and fall by '\'
(Output lines shall not contain trailing spaces)
Constraints
0<n<15
0<height<15
(every mountain's base starts on the bottom-most line)
Example
Input
3
1 2 1
Output
   /\
/\/  \/\

A higher resolution is required to access the IDE

codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants