hacker rank python problem(itertools.permutations())soluiton

itertools.permutations()



from itertools import permutations
l,b=input().split()
l1=list(permutations(l,int(b)))
for i in sorted(l1):
      print(*i,sep='') 



Compiler Message
Success
Input (stdin)Download
HACK 2
Expected OutputDownload
AC
AH
AK
CA
CH
CK
HA
HC
HK
KA
KC
KH

Comments

Popular posts from this blog

Amazon Web Services

Google Code-In mentorship experience :)

Hacker Rank all java and python problem solutions