Microsoft Phone Interview
Anonymous User
778

Given an input string of size 2n, consisting of letter's "a" and "b" only, generate all the different permutation. Input string will always be even size and the number of "a" and "b" will be n.
Eg:
input: "aabb"
output: aabb,abab,abba,bbaa,baba,baab ...

input:"ab"
output: "ab","ba";

input: "aaabbb"
output: ...

Comments (2)