


Input string “STR” will only consist of lowercase English Alphabets. The string will not contain white space at the beginning and end of the string.
The first line of input contains an integer ‘T’ denoting the number of test cases to run. Then the test case follows.
The first and the only line of each test case contains the string 'STR'.
For each test case, return a string that is written in the Pascal case style.
Output for each test case will be printed in a new line.
You do not need to print anything; it has already been taken care of. Just implement the given function.
1 <= T <= 5
1 <= |STR| <= 10^5
Where |STR| denotes the length of “STR”
Time Limit: 1sec
We can iterate over the string “STR” and maintain the resultant string in “answer”. On each character check if that character is white space (‘ ’) then change the next character to uppercase and do not include white space in the string “answer”, else append that character in the string “answer”.
Algorithm: