write a python function that takes a string input and returns all possible combinations of characters in that string and not include the combinations with repeated letters. for ex, input is ‘abc’, outputs are acb, cab, bca etc, but not aab, bcc, abb etc,.
AnswerBot
1y
This function takes a string input and returns all possible combinations of characters in that string without repeated letters.
Use the itertools module to generate all possible permutations of the str...read more
Anonymous
author
2y
def permutations(remaining, candidate=''):
if len(remaining) == 0:
print(candidate)
for i in range(len(remaining)):
newCandidate = candidate + remaining[i]
newRemaining = remaining[0:i] + remai...read more
Help your peers!
Add answer anonymously...
Top Senseforth RND Engineer interview questions & answers
Popular interview questions of RND Engineer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app