kucheasysa

Algoverse_adesh_17

Jun 13th, 2024
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. class Solution:
  2.     def sortVowels(self, s: str) -> str:
  3.         Vowel=["A","E","I","O","U","a","e","i","o","u"]
  4.         a=[]
  5.         c=0
  6.         for i in s:
  7.             if i in Vowel:
  8.                 a.append(i)
  9.             else:
  10.                 continue
  11.         a.sort()
  12.         b=[0]*len(s)
  13.         for i in range(len(s)):
  14.             if s[i] in Vowel:
  15.                 b[i]=a[c]
  16.                 c+=1
  17.             else:
  18.                 b[i]=s[i]
  19.                 continue
  20.         return "".join(b)
  21.        
Advertisement
Add Comment
Please, Sign In to add comment