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

推噓0(0推 0噓 1→)留言1則,0人參與, 1年前最新作者JIWP (神楽めあ的錢包)時間1年前 (2024/03/07 18:39), 編輯資訊
0
0
0
內容預覽:
61. Rotate List. 有一個link list,請把這個link list向右轉k次. 回傳旋傳後的link list. 思路:. 先計算這個link list有幾個node,假設有n個. 向右旋轉k次代表倒數第(k%n)個node會變成head. 如果k%n==0,那旋轉後的link
(還有633個字)

推噓0(0推 0噓 1→)留言1則,0人參與, 1年前最新作者sustainer123 (caster )時間1年前 (2024/03/07 12:46), 編輯資訊
0
0
0
內容預覽:
876. Middle of the Linked List. 找中間值,如有兩個中間值,取第二個. Example 1:. Input: head = [1,2,3,4,5]. Output: [3,4,5]. Explanation: The middle node of the list is
(還有619個字)

推噓5(5推 0噓 7→)留言12則,0人參與, 1年前最新作者sustainer123 (caster )時間1年前 (2024/03/06 17:05), 編輯資訊
0
0
0
內容預覽:
141. Linked List Cycle. 確認linked list是否循環. 思路:. 快慢指針end. Python Code:. # Definition for singly-linked list.. # class ListNode:. # def __init__(self, x
(還有322個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 1年前最新作者DJYOSHITAKA (franchouchouISBEST)時間1年前 (2024/03/06 00:26), 編輯資訊
0
0
0
內容預覽:
1750. Minimum Length of String After Deleting Similar Ends. 有點北爛. 錯了幾次那種答案是0或1的. 最後在return那邊加了髒東西. 對不起. int minimumLength(string s) {. int l = 0;. int
(還有263個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者Rushia (みけねこ的鼻屎)時間1年前 (2024/03/05 09:07), 編輯資訊
0
1
1
內容預覽:
https://leetcode.com/problems/minimum-length-of-string-after-deleting-similar-ends/description1750. Minimum Length of String After Deleting Similar En
(還有690個字)