討論串[LeetCode] 刷到面試 Grind169 C++
共 14 篇文章

推噓3(3推 0噓 3→)留言6則,0人參與, 2年前最新作者SuiseiLeda (彗星雷達)時間2年前 (2023/03/18 15:41), 編輯資訊
0
0
0
內容預覽:
733. Flood Fill easy題. 我好爛 我這完全沒想到要怎麼解. 你們是寫多少題才能直接自己寫出來啊. class Solution {. public:. vector<vector<int>> floodFill(vector<vector<int>>& image, int sr
(還有702個字)

推噓1(1推 0噓 4→)留言5則,0人參與, 2年前最新作者SuiseiLeda (彗星雷達)時間2年前 (2023/03/15 17:42), 編輯資訊
0
0
0
內容預覽:
704. Binary Search easy題. 為啥我寫二分法跑得比暴力解還慢啊. 我有寫錯嗎. 暴力法:. class Solution {. public:. int search(vector<int>& nums, int target) {. for(int i=0; i<nums.s
(還有612個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者SuiseiLeda (彗星雷達)時間2年前 (2023/03/15 17:00), 編輯資訊
0
0
0
內容預覽:
242. Valid Anagram easy題. 哈希表. 第一次遇到這個. 但還滿好懂得. class Solution {. public:. bool isAnagram(string s, string t) {. int hash[26] = {0};. if(s.length()!=t
(還有162個字)

推噓0(0推 0噓 3→)留言3則,0人參與, 2年前最新作者SuiseiLeda (彗星雷達)時間2年前 (2023/03/15 16:23), 編輯資訊
0
0
0
內容預覽:
226. Invert Binary Tree easy題. 二差樹歷遍而已. 難得我會. 但我runtime跟memory超爛. 是要改迭代比較好嗎. class Solution {. public:. TreeNode* invertTree(TreeNode* root) {. if(roo
(還有98個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 2年前最新作者SuiseiLeda (彗星雷達)時間2年前 (2023/03/15 11:25), 編輯資訊
0
0
0
內容預覽:
125. Valid Palindrome easy題. 也是雙指針的題. 這次有想到怎麼解. 但判斷大小寫的函數沒用過. 所以還是有上網查. class Solution {. public:. bool isPalindrome(string s) {. int start = 0;. cons
(還有267個字)