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.
I don't understand the need for reversing the whole string in order to find the smallest alphabetical order because if you reverse it, you are changing the shuffled version.
If one of the strings provided to the merge function is a shuffle, which can return any variation of the original, any sequence of the provided characters should be accepted, including a string with all characters ordered alphabetically.
How does the answer to 'abcdefgabcdefg' become 'agfedcb' when it isn't even part of the provided string?
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 →
I don't understand the need for reversing the whole string in order to find the smallest alphabetical order because if you reverse it, you are changing the shuffled version.
If one of the strings provided to the merge function is a shuffle, which can return any variation of the original, any sequence of the provided characters should be accepted, including a string with all characters ordered alphabetically.
How does the answer to 'abcdefgabcdefg' become 'agfedcb' when it isn't even part of the provided string?