Skip to content

Instantly share code, notes, and snippets.

@Bennyelg
Created February 4, 2019 17:48
Show Gist options
  • Save Bennyelg/41aa2fe02c53bf5078b75b8258d68027 to your computer and use it in GitHub Desktop.
Save Bennyelg/41aa2fe02c53bf5078b75b8258d68027 to your computer and use it in GitHub Desktop.
def get_lucky_version(real_floor: int):
floors: List[int] = []
n = 1
def its_a_bad_luck_floor(floor_no: int):
return "4" in str(floor_no) or "13" in str(floor_no)
for i in range(1, real_floor + 1):
if its_a_bad_luck_floor(n):
n += 1
if its_a_bad_luck_floor(i):
n += 1
floors.append(n)
n += 1
return floors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment