Re: [閒聊] 每日leetcode已回收

看板Marginalman作者 (caster )時間1年前 (2024/08/01 08:11), 編輯推噓3(302)
留言5則, 5人參與, 1年前最新討論串607/1549 (看更多)
https://leetcode.com/problems/number-of-senior-citizens 2678. Number of Senior Citizens 給你details 裡面有個人訊息 前十位數字是電話 第十一位字母是性別 第十二位到第十三位是年齡 回傳年齡>60的人數 思路: 照題目敘述解題 Python Code: class Solution: def countSeniors(self, details: List[str]) -> int: result = 0 for detail in details: if int(detail[11:13]) > 60: result += 1 return result 我是EZ守門員 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.194.160.111 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1722471100.A.44D.html

08/01 08:17, 1年前 , 1F
別捲了
08/01 08:17, 1F

08/01 08:18, 1年前 , 2F
大師
08/01 08:18, 2F

08/01 08:19, 1年前 , 3F
這三小幹題==
08/01 08:19, 3F

08/01 08:20, 1年前 , 4F
所以這EZ 對啊
08/01 08:20, 4F

08/01 20:01, 1年前 , 5F
大師
08/01 20:01, 5F
文章代碼(AID): #1cgjAyHD (Marginalman)
討論串 (同標題文章)
文章代碼(AID): #1cgjAyHD (Marginalman)