Print All Permutations of a String

Print all permutations of a given string.

Statement

Given a string, print all possible permutations of the string.

Example

All permutations of string “bad” are:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.