Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save inspirit941/4c3cebe13697cc32b6da0704e8490f2c to your computer and use it in GitHub Desktop.
Save inspirit941/4c3cebe13697cc32b6da0704e8490f2c to your computer and use it in GitHub Desktop.
def solution(N):
line = [0] * N
line[0], line[1] = 1,1
idx = 2
while idx < len(line):
line[idx] = line[idx-1] + line[idx-2]
idx += 1
return line[-1] * 4 + line[-2] * 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment