Created
November 16, 2024 09:08
-
-
Save vestineo/35fc2538e709b6d278d557d5a97955f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def seeBuildingsLeft(buildings): | |
count = 1 | |
visibleBuilding = buildings[0] | |
for i in range(1, len(buildings)): | |
backBuilding = buildings[i] | |
if visibleBuilding < backBuilding: | |
count += 1 | |
visibleBuilding = backBuilding | |
return count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment