Print Permutations - String Problem Statement

Given an input string 'S', you are tasked with finding and returning all possible permutations of the input string.

Input:

The first and only line of input contains a string 'S' of alphabets in lower case characters.

Output:

Print all the permutations of the given string 'S' on separate lines.

Example:

Input: "abc"
Output:
abc
acb
bac
bca
cab
cba

Constraints:

  • 0 <= |S| <= 8

Note:

  • The input string may contain the same characters, so there can be duplicate permutations.
  • The order of permutations does not matter.
  • You do not need to print anything; it has already been taken care of. Implement the function to return the answer.

AnswerBot
4mo

Return all possible permutations of a given input string.

  • Use recursion to generate all possible permutations of the input string.

  • Swap characters at different positions to generate different permutatio...read more

Help your peers!
Select
Add answer anonymously...

Accenture Software Developer interview questions & answers

A Software Developer was asked 2w agoQ. Describe the SOLID principles.
A Software Developer was asked 1mo agoQ. What is the purpose of if __name__ == "__main__"?
A Software Developer was asked 1mo agoQ. What is Hypertext Markup Language (HTML)?

Popular interview questions of Software Developer

A Software Developer was asked 2w agoQ1. Describe the SOLID principles.
A Software Developer was asked 1mo agoQ2. What is the purpose of if __name__ == "__main__"?
A Software Developer was asked 1mo agoQ3. What is Hypertext Markup Language (HTML)?

Top HR questions asked in Accenture Software Developer

A Software Developer was asked 1w agoQ1. Explain your projects.
A Software Developer was asked 1mo agoQ2. Why do you believe I am required in the company?
A Software Developer was asked 2mo agoQ3. What motivates you to choose a career in the software development field?
Accenture Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits