Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Beautiful skyline solution in Clear category for Building Visibility by new_hoschi
def checkio(buildings):
#for example
buildings=sorted(buildings, key=lambda x:x[1])
visible=0 # number of visible buildings
wys=[0 for _ in range(12)] # wys="what you see" (the highest point)
# at this xcoord (task says x<12)
for building in buildings:
a=min(wys[x] for x in range(building[0],building[2])) # what is the
# lowest point on the skyline where the building may be visible
if a
July 6, 2020