Left Right Print
Dewansh loves strings. His friend Adarsh gave him a simple problem. It was like this - Given a string ‘S’ with only lowercase and uppercase characters. You are supposed to perform two tasks on the entire string. First – Shift the Uppercase character on the left in the order as they are present in the string. Second – Shift the Lowercase character on the right in the order as they are present in the string. You are then supposed to print the new string with all operations done on the string.
- First line of input will contain the number of testcases T.
- Next T lines will contain a String S .
- 1<=|S| (Length of the String) <=100
In case one HelLoWorlD , H is already shifted to the atmost left , 'e' is shifted to the atmost right
HlLoWorlDe then 'l' is shifted atmost right after 'e'
HLoWorlDel 'L' is not shifted furthur as it comes after 'H' in original string as well. 'o' is shifted atmost right.
HLWorlDelo again 'W' is correctly placed and no shifting is required. furthur letters 'o', 'r', 'l' are shifted atmost right one after the other giving output -
HLWDeloorl. Similarly second string is operated.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions