Skip to content

Instantly share code, notes, and snippets.

@dearshrewdwit
Created May 2, 2025 12:41
Show Gist options
  • Save dearshrewdwit/76146d251c699d05f3e504b241679604 to your computer and use it in GitHub Desktop.
Save dearshrewdwit/76146d251c699d05f3e504b241679604 to your computer and use it in GitHub Desktop.
Tile Top Temptation
data = [int(i) for i in input().split(" ")] # enter: "3 2 5 1 7"
def run(data, in_order=False, days=0):
j = 1
in_order = True
while j < len(data):
if data[j] < data[j-1]:
in_order = False
data[j] +=1
j+=1
if in_order:
return days
else:
return run(data, in_order, days+1)
print(run(data)) # expected: 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment