File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ written by Pankaj Kumar.
3+ country:-INDIA
4+ */
5+ typedef long long ll ;
6+ const ll INF=1e18 ;
7+ const ll mod1=1e9 +7 ;
8+ const ll mod2=998244353 ;
9+ // Add main code here
10+
11+ class Solution
12+ {
13+ public:
14+ bool checkvowels (char ch)
15+ {
16+ if (ch == ' a' || ch == ' e' || ch == ' i' || ch == ' o' || ch == ' u' )
17+ return true ;
18+ if (ch == ' A' || ch == ' E' || ch == ' I' || ch == ' O' || ch == ' U' )
19+ return true ;
20+ return false ;
21+ }
22+ string sortVowels (string s)
23+ {
24+ string temp=" " ;
25+ for (auto x : s)
26+ {
27+ if (checkvowels (x)){
28+ temp += x;
29+ }
30+ }
31+ int j = 0 ;
32+ sort (temp.begin (), temp.end ());
33+ for (int i = 0 ; i < s.size (); i++)
34+ {
35+ if (checkvowels (s[i]))
36+ {
37+ s[i] = temp[j];
38+ j++;
39+ }
40+ }
41+ return s;
42+ }
43+ };
You can’t perform that action at this time.
0 commit comments