We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae5e710 commit 55de8a1Copy full SHA for 55de8a1
1501-2000/1704.py
@@ -10,3 +10,22 @@ def halvesAreAlike(self, s: str) -> bool:
10
count -= 1
11
12
return count==0
13
+
14
15
+class Solution:
16
+ def halvesAreAlike(self, s: str) -> bool:
17
+ def is_vowel(x):
18
+ v = "aeiouAEIOU"
19
+ return x in v
20
21
+ c = 0
22
+ for i in range(len(s)//2):
23
+ if is_vowel(s[i]):
24
+ c+=1
25
+ if is_vowel(s[len(s)-i-1]):
26
+ c-=1
27
28
+ return c==0
29
30
31
0 commit comments