2dbi
Home/Cisco/All Permutations of a String (Iterative + Recursive)
CCisco·DSAGrade 8Technical Phone Screen

All Permutations of a String (Iterative + Recursive)

Problem

Print all permutations of a string both recursively and iteratively.

Example

"abc" -> abc, acb, bac, bca, cab, cba

Constraints

  • 1 ≤ |s| ≤ 8

What Cisco looks for

Be ready with both approaches and to handle duplicate characters.

added 6 days ago
LeadersAccount