java.lang.Object
g0301_0400.s0345_reverse_vowels_of_a_string.Solution

public class Solution extends Object
345 - Reverse Vowels of a String.<p>Easy</p> <p>Given a string <code>s</code>, reverse only all the vowels in the string and return it.</p> <p>The vowels are <code>'a'</code>, <code>'e'</code>, <code>'i'</code>, <code>'o'</code>, and <code>'u'</code>, and they can appear in both cases.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> s = &ldquo;hello&rdquo;</p> <p><strong>Output:</strong> &ldquo;holle&rdquo;</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> s = &ldquo;leetcode&rdquo;</p> <p><strong>Output:</strong> &ldquo;leotcede&rdquo;</p> <p><strong>Constraints:</strong></p> <ul> <li>1 <= s.length <= 3 * 105</li> <li><code>s</code> consist of <strong>printable ASCII</strong> characters.</li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details