Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def sortVowels(self, s: str) -> str:
- Vowel=["A","E","I","O","U","a","e","i","o","u"]
- a=[]
- c=0
- for i in s:
- if i in Vowel:
- a.append(i)
- else:
- continue
- a.sort()
- b=[0]*len(s)
- for i in range(len(s)):
- if s[i] in Vowel:
- b[i]=a[c]
- c+=1
- else:
- b[i]=s[i]
- continue
- return "".join(b)
Advertisement
Add Comment
Please, Sign In to add comment