Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 41e7749

Browse files
committed
Time: 0 ms (100.00%) | Memory: 17.6 MB (98.36%) - LeetSync
1 parent 36c9b5c commit 41e7749

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution:
2+
def maxFreqSum(self, s: str) -> int:
3+
vowel_list = Counter()
4+
const_list = Counter()
5+
vowel = {"a", "e", "i", "o", "u"}
6+
for char in s:
7+
if char in vowel:
8+
vowel_list[char] +=1
9+
else:
10+
const_list[char] +=1
11+
if not vowel_list:
12+
return max(const_list.values())
13+
elif not const_list:
14+
return max(vowel_list.values())
15+
16+
return max(vowel_list.values()) + max(const_list.values())

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /