Given a string A containing lowercase and uppercase letters.
You need to sort it in such a manner such that the uppercase and lowercase letter comes in an alternate manner but in sorted way.
See the example Input and Output for better explanation.
1 <= |A| <= 105
First argument is an string A.
Return a string such that the uppercase and lowercase letter in A comes in an alternate manner but in sorted way.
A = "bAwutndekWEdkd"
A = "bbBBaa"
A = "abbfDDhGFBvdFDGBNDasZVDFjkb"
Here we can see that letter ‘A’, ’E’, ’W’ are sorted as well as letters “b, d, d, d, e, k, k, n, t, u, w” are sorted but both appears alternatively in the string as far as possible.
Here we can see that letter 'B' and 'B'are sorted as well as characters "a, a, b, b" are sorted but both appears alternatively in the string as far as possible.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.