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 80+ hands-on prep courses.