wrong answer in some cases
Wrong answer in some cases
here when you have to print in sorted order and also character can be duplicate this approach will not hold true
you have to think in terms of next_permutation.
see in the code i have modified it