Skip to content

Instantly share code, notes, and snippets.

@vestineo
Created November 16, 2024 09:08
Show Gist options
  • Save vestineo/35fc2538e709b6d278d557d5a97955f0 to your computer and use it in GitHub Desktop.
Save vestineo/35fc2538e709b6d278d557d5a97955f0 to your computer and use it in GitHub Desktop.
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