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

推噓2(2推 0噓 0→)留言2則,0人參與, 1年前最新作者SecondRun (南爹摳打)時間1年前 (2024/04/05 12:32), 編輯資訊
0
0
0
內容預覽:
1544. Make The String Great. input string假如有相鄰的同樣字母的大小寫,移除這組字母. 重複這個動作直到沒有相鄰大小寫. 想法:移除了之後還要檢查移除組的左右,用index很麻煩所以用stack. C# code:. public class Solution
(還有462個字)

推噓1(1推 0噓 3→)留言4則,0人參與, 1年前最新作者sustainer123 (caster )時間1年前 (2024/04/04 15:22), 編輯資訊
0
0
1
內容預覽:
https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses. 1614. Maximum Nesting Depth of the Parentheses. 敘述很長 但其實不太重要. 思路:. 計算() 遇(+1 更
(還有170個字)

推噓3(3推 0噓 2→)留言5則,0人參與, 1年前最新作者sustainer123 (caster )時間1年前 (2024/04/03 18:09), 編輯資訊
0
0
1
內容預覽:
照抄大老思路. 我本來想說是bfs. 結果後面時間炸裂. Python code:. class Solution:. def exist(self, board: List[List[str]], word: str) -> bool:. m = len(board[0]). n = len(bo
(還有780個字)

推噓2(2推 0噓 1→)留言3則,0人參與, 1年前最新作者HGK (HGK)時間1年前 (2024/04/03 17:54), 1年前編輯資訊
0
0
0
內容預覽:
GPT老師. 針對單詞搜索問題,提供的程式碼片段存在幾個邏輯和結構上的問題,這些問題可能會影響程式的正確性和效率。以下是問題的詳細審查以及如何解決這些問題以改善程式碼:. 每次DFS呼叫重新初始化visited:visited列表在不同的起始點和遞迴DFS呼叫中共享,這可能會導致不正確的行為,因為對
(還有1657個字)

推噓6(6推 0噓 5→)留言11則,0人參與, 1年前最新作者sustainer123 (caster )時間1年前 (2024/04/03 17:18), 編輯資訊
0
0
1
內容預覽:
求救一下. 照著溫莎思路寫了一下. 但一直過不了. 想問一下可能問題在哪. py code:. class Solution:. def exist(self, board: List[List[str]], word: str) -> bool:. m = len(board[0]). n = l
(還有827個字)