#C4327. String Transformation Game
String Transformation Game
String Transformation Game
You are given a string transformation problem. You need to transform a given string s according to the following rules:
- If the substring
abc
appears in s, replace its first occurrence withxyz
. - Else, if the length of s is exactly 5, then reverse the string.
- Else, if the string starts with the character
a
and ends with the characterz
, remove all vowels (both lowercase and uppercase). In mathematical terms, if vowels are defined as $$V = \{a, e, i, o, u, A, E, I, O, U\},$$ then remove every character \( c \) from s if \( c \in V \). - If none of the conditions above hold, convert the entire string to uppercase.
You are to process multiple test cases. For each test case, apply the transformation and print the result.
inputFormat
The first line contains an integer N
, representing the number of test cases. The following N
lines each contain a single string s to be transformed.
outputFormat
For each test case, output the transformed string on a new line.
## sample5
abcdef
hello
applez
coding
hacktober
xyzdef
olleh
pplz
CODING
HACKTOBER
</p>