Logic to find permutations of a string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Logic to find permutations of a string

to print all possible combination of characters in a string

30th Nov 2016, 1:24 PM
sujatha v
sujatha v - avatar
2 Answers
+ 2
p (n,r) = n!/(n-r)! is the formula for finding the no. of permutations
30th Nov 2016, 4:39 PM
Harshit
0
that was interesting, and I've searched for info. there is a function for this in Python's standard module 'itertools'. look at my code: http://www.sololearn.com/app/sololearn/playground/ctmEhmAQOsfI/ in future, try finding some info by yourself first, it's a really great skill for a good programmer.
30th Nov 2016, 5:38 PM
Demeth
Demeth - avatar