討論串[閒聊] 每日LeetCode
共 719 篇文章

推噓2(2推 0噓 3→)留言5則,0人參與, 1年前最新作者JIWP (神楽めあ的錢包)時間1年前 (2024/01/29 14:59), 編輯資訊
0
0
0
內容預覽:
其實我看不懂這題要幹嘛啊. 我是直接實作一個queue就結束了. 沒用到stack. --. 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.82.203.18 (臺灣). 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1706511572.

推噓4(4推 0噓 9→)留言13則,0人參與, 1年前最新作者oin1104 (是oin的說)時間1年前 (2024/01/29 14:34), 編輯資訊
0
0
0
內容預覽:
我把他全部丟進第二個stack. 然後他就會倒過來. 然後把上面的丟掉. 然後再塞回去. 感覺好麻煩喔= =. 然後那個MyQueue()是在幹嘛的阿. 我不知道他是什麼. class MyQueue {. public:. vector<int> stack1;. vector<int> stac
(還有793個字)

推噓1(1推 0噓 4→)留言5則,0人參與, 1年前最新作者JerryChungYC (JerryChung)時間1年前 (2024/01/29 14:04), 編輯資訊
0
3
1
內容預覽:
https://leetcode.com/problems/implement-queue-using-stacks. 232. Implement Queue using Stacks. 利用 2 個堆疊 (stacks) 實作先進先出 (FIFO). 實作 class MyQueue. void
(還有1626個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 1年前最新作者Rushia (みけねこ的鼻屎)時間1年前 (2024/01/28 23:30), 編輯資訊
0
2
1
內容預覽:
1074. Number of Submatrices That Sum to Target. https://leetcode.com/problems/number-of-submatrices-that-sum-to-target/description給你一個二維陣列表示的矩陣和一個 tar
(還有1205個字)

推噓3(3推 0噓 7→)留言10則,0人參與, 1年前最新作者JIWP (神楽めあ的錢包)時間1年前 (2024/01/28 18:15), 1年前編輯資訊
0
0
0
內容預覽:
我用hash table + prefix sum. 寫起來也沒有4個迴圈快. 一定是我太爛了. 太苦了. func numSubmatrixSumTarget(matrix [][]int, target int) int {. n := len(matrix). m := len(matrix[
(還有799個字)