For the best experience, increase the window size or view on a laptop or desktop device
Title | ||
|---|---|---|
Loading... | ||
For the best experience, increase the window size or view on a laptop or desktop device
Title | ||
|---|---|---|
Loading... | ||
Given a list of numbers where each number represents the height of a building, and we are looking to the right, a taller building will block the view of the buildings behind it. Write a function that outputs the highest building each building can see; if a building cannot see any taller buildings, output -1 for that building.
Given a list of numbers where each number represents the height of a building, and we are looking to the right, a taller building will block the view of the buildings behind it. Write a function that outputs the highest building each building can see; if a building cannot see any taller buildings, output -1 for that building.
Output