Skip to content

Instantly share code, notes, and snippets.

View gurdeep999's full-sized avatar
💭
Key in..key out..repeat

Gurdeep gurdeep999

💭
Key in..key out..repeat
View GitHub Profile
def maxHeight(wallPositions, wallHeights):
# Write your code here
n = len(wallPositions)
mud_max = 0
for i in range(0, n - 1):
if wallPositions[i] < (wallPositions[i + 1] - 1):
# We have a gap
heightDiff = abs(wallHeights[i + 1] - wallHeights[i])
gapLen = wallPositions[i + 1] - wallPositions[i] - 1
localMax = 0