Reverse Vowels of a String

Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Input: "hello" Output: "holle" Example 2: Input: "leetcode" Output: "leotcede" Solution public class Solution { public string ReverseVowels(string s) { string vowel = "aeiouAEIOU"; int left = 0, right = s.Length-1; char[] c = s.ToCharArray(); while(left … Continue reading Reverse Vowels of a String