Created
November 4, 2015 11:59
-
-
Save kharandziuk/b1052f67194a6ac38fd7 to your computer and use it in GitHub Desktop.
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 rotations(num): | |
str_num = str(num) | |
result = set() | |
for mid in xrange(len(str_num)): | |
result.add( | |
str_num[mid:] + str_num[:mid] | |
) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment