Re: [閒聊] 每日leetcode
怎麼都是一些怪怪的題目
一二三四五
def doesAliceWin(self, s: str) -> bool:
ct = Counter(s)
v_cnt = ct['a']+ct['e']+ct['i']+ct['o']+ct['u']
if v_cnt == 0:
return False
else:
return True
def maxFreqSum(self, s: str) -> int:
a = 0
b = 0
mp = defaultdict(int)
for c in s:
mp[c] += 1
if c in ['a','e','i','o','u']:
a = max(a, mp[c])
else:
b = max(b, mp[c])
return a+b
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.132.58.28 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1757749585.A.482.html
→
09/13 15:48,
2月前
, 1F
09/13 15:48, 1F
討論串 (同標題文章)
完整討論串 (本文為第 1521 之 1549 篇):