Easy to Understand Solution || beginner friendly✅✨
IntuitionAdd all the vowels in an array and sort the array.
Replace characters in string s if it's a vowel from the new array.ApproachFirstly extracting all the
# Intuition
Add all the vowels in an array and sort the array.
Replace characters in string s if it's a vowel from the new array.

# Approach
<!-- Describe your approach to solving the problem. -->
Firstly extracting all the vowels from the given string into StringBuilder and sorting them using sort() method.

Now I got the array with sorted vowels.

Iterate simply in the given string and replace the vowels occuring from the sorted array.😊

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(nlogn)

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
O(n)

# Code
```java []
class Solution {
    public String sortVowels(String s) {
        StringBuilder sb = new StringBuilder(); 
        for(int i = 0 ; i<s.length();i++){
            char ch = s.charAt(i);
            if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U'){
                sb.append(ch);
            }
        }

        char[] charArray = sb.toString().toCharArray();
        Arrays.sort(charArray);
        String s1="";
        int j = 0;
        for(int i = 0 ; i<s.length();i++){
            char ch = s.charAt(i);
            if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U'){
                s1 = s1+charArray[j];
                j++;
            }
            else{
                s1 = s1+s.charAt(i);
            }
            
        }
        return s1;
    }
}
```
['String', 'Java']