討論串[閒聊] 每日leetcode
共 1552 篇文章

推噓2(2推 0噓 1→)留言3則,0人參與, 9月前最新作者sixB (6B)時間9月前 (2025/02/19 01:24), 編輯資訊
0
1
0
內容預覽:
2375.. 排數字不能重複. 看要求給他上上下下. 今天的好簡單. 我只會寫這種簡單的. class Solution {. public:. string smallestNumber(string p) {. p = "I" + p;. int n = p.length();. string
(還有239個字)

推噓0(0推 0噓 1→)留言1則,0人參與, 9月前最新作者Rushia (早瀬ユウカの体操服 )時間9月前 (2025/02/18 00:10), 編輯資訊
0
1
1
內容預覽:
https://leetcode.com/problems/letter-tile-possibilities/description. 1079. Letter Tile Possibilities. 給你一個字串tiles,你可以任取至少1個以上的字元,求出共有幾種組合。. 思路:. 普通回溯法
(還有726個字)

推噓1(1推 0噓 1→)留言2則,0人參與, 9月前最新作者Rushia (早瀬ユウカの体操服 )時間9月前 (2025/02/15 22:16), 編輯資訊
0
1
1
內容預覽:
https://leetcode.com/problems/find-the-punishment-number-of-an-integer/description2698. Find the Punishment Number of an Integer. 給你一個數字n,找出1~n之間的懲罰數字
(還有882個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者dont (dont)時間9月前 (2025/02/14 20:11), 編輯資訊
0
0
0
內容預覽:
1352. Product of the Last K Numbers. ## 思路. Prefix Product. 用size_紀錄目前Product的個數. 如果add 0 就reset Prefix跟size_. getProduct: prefix[-1] / prefix[size_-k
(還有683個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者dont (dont)時間10月前 (2025/02/12 21:11), 編輯資訊
0
0
0
內容預覽:
2342. Max Sum of a Pair With Equal Sum of Digits. ## 思路. 用hash table紀錄digitSum的最大值. table有相同的digitSum就計算兩數和. ## Code. ```cpp. class Solution {. public
(還有551個字)