An Online English grammar tutorial for kids has
designed an assignment for its students . In the assessment a word will be
displayed on the screen and the students must recreate that word by reversing
each vowel in the word . The first vowel should be reversed with the last vowel,
the second vowel with second last and so
on. If it is not possible to reverse the vowel print the word as it is. A word
is the concatenation of different characters tagged [a-z]or[A-Z] without any
space present between any of characters.
Write an algorithm to recreate the new word by
reversing the vowels in original word.
Input:
The input consists of string originalWord representing the word
displayed to the student on the screen.
Output:
Print a string representing the new word after the vowels in the original
word have been reversed .
Example:
Input:
Heelou
Output:
Huolee
Vowels in the input have been reversed and concatenated to give
output
0 Comments
Post a Comment