Skip to content

Instantly share code, notes, and snippets.

@kharandziuk
Created November 4, 2015 11:59
Show Gist options
  • Save kharandziuk/b1052f67194a6ac38fd7 to your computer and use it in GitHub Desktop.
Save kharandziuk/b1052f67194a6ac38fd7 to your computer and use it in GitHub Desktop.
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