Skip to content

Instantly share code, notes, and snippets.

@ThomasHigginson
Created March 31, 2022 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasHigginson/985d141544b6fabb603832d1e4401833 to your computer and use it in GitHub Desktop.
Save ThomasHigginson/985d141544b6fabb603832d1e4401833 to your computer and use it in GitHub Desktop.
ans = 0
for i in range(0, len(height)):
ans += max(0, min(maxLefts[i], maxRights[i]) - height[i]) # Dont want to add negatives
return ans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment