#C11799. Rearrange Characters in a String
Rearrange Characters in a String
Rearrange Characters in a String
You are given a string s
consisting only of English alphabetic characters. Your task is to rearrange the string so that all lowercase letters come first, followed by all uppercase letters, while preserving the relative order of the characters in each group.
For example, if s = "hAckErInG"
, then the output should be "hckrnAEIG"
because the lowercase characters h, c, k, r, n
appear first in the order they are in the original string, followed by the uppercase characters A, E, I, G
.
This problem tests your understanding of string manipulation and order preservation.
inputFormat
The input consists of a single line containing the string s
(which may be empty). The string only includes uppercase and lowercase English letters.
outputFormat
Output a single line containing the rearranged string where all lowercase letters come first and all uppercase letters come next, maintaining their original relative order from the input.
## samplehAckErInG
hckrnAEIG