We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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".
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse Shuffle Merge
You are viewing a single comment's thread. Return to all 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".