Showing:
Handle Score
@Ibrahim Nash 5761
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4944
@saiujwal13083 4506
@sanjay05 3762
@marius_valentin_dragoi 3516
@sushant_a 3459
@verma_ji 3341
@KshamaGupta 3318
Unusual String Sort
Easy Accuracy: 36.68% Submissions: 90 Points: 2

Given a string composed of both lowercase and uppercase letters. Sort it in such a manner such that the uppercase and lowercase letter comes in an alternate manner but in sorted way.

Example 1:

Input:
S = bAwutndekWEdkd
Output: AbEdWddekkntuw
Explanation: letters A,E,W are sorted
as well as letters b,d,d,d,e,k,k,n,t,u,w are
sorted and both appears alternately in the
string as far as possible.


â€‹Example 2:

Input:
S = AiBFR
Output: AiBFR
Explanation: letters A,B,F,R and sorted
as well as letter i.


You don't need to read input or print anything. You just have to complete the function stringSort () which takes a string as input and returns the sorted string as described in the problem description.

Expected Time Complexity: O(|S|).
Expected Auxiliary Space: O(1).

Constraints:
1<=|S|<=1000