Reverse Shuffle Merge

  • + 2 comments

    To clarify more on your doubt, consider S = "aabb", lexicographically smallest string inside S is "ab". But for A="ab" you can never obtain this S. Hence, the answer should be A="ba".