Created
May 2, 2025 12:41
-
-
Save dearshrewdwit/76146d251c699d05f3e504b241679604 to your computer and use it in GitHub Desktop.
Tile Top Temptation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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