討論串[閒聊] 每日leetcode
共 1548 篇文章
內容預覽:
針對每個可能的residual爆搜. 有偷看別人答案. 我好爛. def maximumLength(self, nums: List[int], k: int) -> int:. res_arr = [num%k for num in nums]. ans = -1. for res in ran
(還有260個字)
內容預覽:
跟昨天那題很像. 3202. Find the Maximum Length of Valid Subsequence II. 看了一下題目限制, nums長度跟k都不超過10^3. 這樣就把(sub[0] + sub[1]) %k後的每一種餘數 0 ~ k-1進行個別計算. 假設現在要找的餘數是a
(還有570個字)