Skip to content

Instantly share code, notes, and snippets.

@libert-xyz
Created August 1, 2016 21:09
Show Gist options
  • Select an option

  • Save libert-xyz/1ceb7ffe4e60558c1d80336f24cbf8f8 to your computer and use it in GitHub Desktop.

Select an option

Save libert-xyz/1ceb7ffe4e60558c1d80336f24cbf8f8 to your computer and use it in GitHub Desktop.
#8/1/16
#https://www.hackerrank.com/challenges/itertools-permutations
from itertools import permutations
s = raw_input().split()
l = (permutations(sorted(s[0]),int(s[1])))
for i in l:
print ''.join(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment