If STR = ‘aBc’,
After converting ‘a’ to ‘A’, ‘B’ to ‘b’, and ‘c’ to ‘C’ we got our final string as ‘AbC’.
The first line of the input contains an integer, 'T’, denoting the number of test cases.
The first and only line of each test case contains a non-empty string of characters(a - z, A - Z).
For each test case, print the string after converting the characters of the string into the opposite case.
Print a separate line for each test case.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= str.length <= 10000
Time limit: 1 sec
The ASCII values of lowercase English alphabets lie in the range 97-122 where 97 is the ASCII value of ‘a’ and 122 is of ‘z’. Similarly, the ASCII values of uppercase English alphabets lie in the range 65-90 where 65 is the ASCII value of ‘A’ and 90 is of ‘Z’. If we have an uppercase alphabet then we just have to add 32 to convert it to lowercase and if we have a lowercase alphabet then we just have to subtract 32 to convert it to uppercase.