Write a function that takes a string as input and reverse only the vowels of a string.
Example 1:
Given s = "Hello", Return "Holle".
Example 2:
Given s = "Leetcode", Return "Leotcede".
1 Char* Reversevowels (Char*s) {2 inti;3 intJ;4 Chartemp;5i =0;6j = strlen (s)-1;7 while(I <j) {8 9 if(S[i]! ='a'&& S[i]! ='e'&& S[i]! ='I'&& S[i]! ='o'&& S[i]! ='u'&& S[i]! ='A'&& S[i]! ='E'&& S[i]! ='I'&& S[i]! ='O'&& S[i]! ='U')Teni++; One if(S[j]! ='a'&& S[j]! ='e'&& S[j]! ='I'&& S[j]! ='o'&& S[j]! ='u'&& S[j]! ='A'&& S[j]! ='E'&& S[j]! ='I'&& S[j]! ='O'&& S[j]! ='U') Aj--; - if((s[i] = ='a'|| S[i] = ='e'|| S[i] = ='I'|| S[i] = ='o'|| S[i] = ='u'|| S[i] = ='A'|| S[i] = ='E'|| S[i] = ='I'|| S[i] = ='O'|| S[i] = ='U') && (s[j] = ='a'|| S[J] = ='e'|| S[J] = ='I'|| S[J] = ='o'|| S[J] = ='u'|| S[J] = ='A'|| S[J] = ='E'|| S[J] = ='I'|| S[J] = ='O'|| S[J] = ='U')) - { thetemp =S[i]; -S[i] =S[j]; -S[J] =temp; -i++; +j--; - } + A } at returns; -}
Reverse vowels of a String