Share your repls and programming experiences

← Back to all posts
##### ReplProblemOfTheWeek #3 - Buildings
theangryepicbanana

(I have no clue how hardit does this, so imma do this my way)

Welcome to the 3rd repl.it problem of the week!

## This week's problem - buildings

You are standing in front of a lot of buildings for some reason, and they are somehow lined up in a single line. Many of these buildings are different heights, so some are taller or shorter than others.

#### Part A

You need to figure out how many buildings that you can see.
For example, given `2, 3, 1, 4` (each number is the height of the building), you can see the first, second, and fourth buildings, because the second building is taller than the third.

#### Part B

You need to figure out how many buildings of each height that you can see.
For example, given `2, 3, 1, 3, 2, 4, 3, 4`, you can see:

• 1 building with a height of 2
• 1 building with a height of 3
• and 1 building with a height of 4

Voters
liseguillon
DrankArizonaIce
sraawuthidiihnu
theangryepicbanana
hotnewtop
B0T

:thinking:

PYer

sounds fun!

theangryepicbanana

Let me know if you have any questions about the problem (I'm not giving you the answer tho)

[deleted]

GL to everybody! Also first

theangryepicbanana