Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Mountain Scape by tokiojapan55
from typing import List, Tuple
def mountain_scape(tops: List[Tuple[int, int]]) -> int:
triangles = set()
for tx,ty in tops:
for row in range(0, ty):
triangles |= {(x, ty-row) for x in range(tx-row, tx+row+1)}
return len(triangles)
Nov. 17, 2020
Comments: