Created
August 30, 2016 22:25
-
-
Save dancaps/f7b9446428439bc4a9f9efb0b3630201 to your computer and use it in GitHub Desktop.
Rotate for a Max
This file contains 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
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