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.
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|).