Skip to content

Instantly share code, notes, and snippets.

@aliwo
Created October 1, 2019 06:02
Show Gist options
  • Save aliwo/cd8cb52cff5f401032023f09f31998c7 to your computer and use it in GitHub Desktop.
Save aliwo/cd8cb52cff5f401032023f09f31998c7 to your computer and use it in GitHub Desktop.
solution = lambda t, l = []: max(l) if not t else solution(t[1:], [max(x,y)+z for x,y,z in zip([0]+l, l+[0], t[0])])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment