Re: [閒聊] 每日leetcode
現在真的是沒人在寫了喔
哀 剩我還沒上岸了
easy還WA的人就這樣了
def divideString(self, s: str, k: int, fill: str) -> List[str]:
ans = []
i = 0
while i<len(s):
cur = ""
for j in range(k):
if i+j < len(s):
cur += s[i+j]
else:
cur += fill
i = i+k
ans.append(cur)
return ans
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.132.58.28 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1750602296.A.741.html
推
06/22 22:26,
5月前
, 1F
06/22 22:26, 1F
→
06/22 22:29,
5月前
, 2F
06/22 22:29, 2F
推
06/22 22:41,
5月前
, 3F
06/22 22:41, 3F
→
06/23 21:41,
5月前
, 4F
06/23 21:41, 4F
討論串 (同標題文章)
完整討論串 (本文為第 1449 之 1548 篇):