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...
Senseforth RND Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
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

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter