# def reverseVowels(s: str) -> str:
#     vowel = 'AEIOUaeiou'
#     s = list(s)
#     p1, p2 = 0, len(s) - 1
#
#     while p1 < p2:
#         while s[p1] not in vowel and p1 < p2:
#             p1 = p1 + 1
#         while s[p2] not in vowel and p1 < p2:
#             p2 = p2 - 1
#         s[p1], s[p2] = s[p2], s[p1]
#         p1, p2 = p1 + 1, p2 - 1
#
#     return ''.join(s)

def reverseVowels(s: str) -> str:
    vowels = [i for i in s if i in 'aeiouAEIOU']
    s1 = list(s)
    for i in range(len(vowels) // 2):
        s1[vowels[i]], s1[vowels[-i - 1]] = s1[vowels[-i - 1]], s1[vowels[i]]

    return ''.join(s1)
# def reverseVowels(s: str) -> str:
#     vowel = 'AEIOUaeiou'
#     s = list(s)
#     p1, p2 = 0, len(s) - 1
#
#     while p1 < p2:
#         while s[p1] not in vowel and p1 < p2:
#             p1 = p1 + 1
#         while s[p2] not in vowel and p1 < p2:
#             p2 = p2 - 1
#         s[p1], s[p2] = s[p2], s[p1]
#         p1, p2 = p1 + 1, p2 - 1
#
#     return ''.join(s)

def reverseVowels(s: str) -> str:
    vowels = [i for i in s if i in 'aeiouAEIOU']
    s1 = list(s)
    for i in range(len(vowels) // 2):
        s1[vowels[i]], s1[vowels[-i - 1]] = s1[vowels[-i - 1]], s1[vowels[i]]

    return ''.join(s1)
# def reverseVowels(s: str) -> str: #     vowel = 'AEIOUaeiou' #     s = list(s) #     p1, p2 = 0, len(s) - 1 # #     while p1 < p2: #         while s[p1] not in vowel and p1 < p2: #             p1 = p1 + 1 #         while s[p2] not in vowel and p1 < p2: #             p2 = p2 - 1 #         s[p1], s[p2] = s[p2], s[p1] #         p1, p2 = p1 + 1, p2 - 1 # #     return ''.join(s)