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.
- Prepare
- Algorithms
- Greedy
- Reverse Shuffle Merge
- Discussions
Reverse Shuffle Merge
Reverse Shuffle Merge
Sort by
recency
|
210 Discussions
|
Please Login in order to post a comment
Rather simplistic greedy approach (Python3) in 30 lines total:
Can some please explain when, string = "abcdefgabcdefg";
then how is "agfedcb" the lexicographically smallest .
shouldn't it be "abcdefg" ??
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?
Solution with Javascript
5 days later and family concerned for my mental health.... Third times a charm.
In Swift Really too much complicated problem
}