Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day 285 #583

Closed
vaskoz opened this issue Jun 3, 2019 · 0 comments · Fixed by #584
Closed

Day 285 #583

vaskoz opened this issue Jun 3, 2019 · 0 comments · Fixed by #584
Assignees

Comments

@vaskoz
Copy link
Owner

vaskoz commented Jun 3, 2019

Good morning! Here's your coding interview problem for today.

This problem was asked by Mailchimp.

You are given an array representing the heights of neighboring buildings on a city street, from east to west. The city assessor would like you to write an algorithm that returns how many of these buildings have a view of the setting sun, in order to properly value the street.

For example, given the array [3, 7, 8, 3, 6, 1], you should return 3, since the top floors of the buildings with heights 8, 6, and 1 all have an unobstructed view to the west.

Can you do this using just one forward pass through the array?

@vaskoz vaskoz self-assigned this Jun 3, 2019
@vaskoz vaskoz mentioned this issue Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant