School Accuracy: 62.92%
Submissions: 2731 Points: 0
Given a string consisting of lowercase english alphabets, reverse only the vowels present in it and print the resulting string.
S = "geeksforgeeks"
Explanation: The vowels are: e, e, o, e, e
Reverse of these is also e, e, o, e, e.
â€‹ Example 2:
S = "practice"
Explanation: The vowels are a, e
Reverse of these is e, a.
You don't need to read input or print anything. Your task is to complete the function modify() which takes the string S as input and returns the resultant string by reversing only the vowels present in S.
Expected Time Complexity: O(|S|). Expected Auxiliary Space: O(|S|).