Skip to content

Instantly share code, notes, and snippets.

@dancaps
Created August 30, 2016 22:25
Show Gist options
  • Save dancaps/f7b9446428439bc4a9f9efb0b3630201 to your computer and use it in GitHub Desktop.
Save dancaps/f7b9446428439bc4a9f9efb0b3630201 to your computer and use it in GitHub Desktop.
Rotate for a Max
def max_rot(n):
n = list(str(n))
answer = [int(''.join(n))]
for i in range(len(n)):
n.append(n.pop(int(i)))
answer.append(int(''.join(n)))
return max(answer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment