https://leetcode.com/problems/reverse-vowels-of-a-string/?tab=Description
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".
bool IsVowels(char ch) { return (ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || ch == 'I' || ch == 'o' || ch == 'O' || ch == 'u' || ch == 'U'); } char* reverseVowels(char* s) { if(!s) return NULL; int len = strlen(s); char swapTmp; int head = 0, tail = len; while(head < tail) { while(head < tail && !IsVowels(s[head])) head++; while(head < tail && !IsVowels(s[tail])) tail--; swapTmp = s[head]; s[head] = s[tail]; s[tail] = swapTmp; head++; tail--; } return s; }