Re: [閒聊] 每日leetcode

看板Marginalman作者 (通通打死)時間1月前 (2025/10/16 08:20), 編輯推噓1(101)
留言2則, 2人參與, 1月前最新討論串1534/1548 (看更多)
好久沒有在早上寫了 先取餘數再count 然後看看哪個餘數的count最小 坑就會在那邊 找到那個坑即可 def findSmallestInteger(self, nums: List[int], value: int) -> int: res_cnt = [0]*value for num in nums: res_cnt[num%value] += 1 def argmin(a): # will return leftmost if equal return min(range(len(a)), key=lambda x : a[x]) return argmin(res_cnt)+value*min(res_cnt) -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.132.58.28 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1760574048.A.72D.html

10/16 09:19, 1月前 , 1F
今天請假嗎?
10/16 09:19, 1F

10/16 13:44, 1月前 , 2F
比較早起床
10/16 13:44, 2F
文章代碼(AID): #1ey3fWSj (Marginalman)
討論串 (同標題文章)
文章代碼(AID): #1ey3fWSj (Marginalman)