討論串[LeetCode] 刷到面試 Grind169 C++
共 14 篇文章
內容預覽:
Best Time to Buy and Sell Stock easy題. 我自己會暴力解. 然後當然不會過. 可悲. 然後學一下DP怎麼寫. 題外話. 要怎麼runtime跟memory都beat90%啊. 要壓那麼低是有甚麼特殊解法嗎. 還是單純我太爛. class Solution {. p
(還有382個字)
內容預覽:
Merge Two Sorted Lists easy題. 這一次也不會寫. 是看別人講解後才寫出來的. 他媽的指針指針指針脂增. class Solution {. public:. ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {. if
(還有465個字)
內容預覽:
Valid Parentheses easy題. 幹. 寫了這題我才發現我不會用stack. 以前作業全都用vector+雙迴圈寫. 我好可悲. class Solution {. public:. bool isValid(string s) {. stack<char> st;. for(int
(還有533個字)
內容預覽:
Two Sum easy題. 用雙迴圈解. 我好爛. class Solution {. public:. vector<int> twoSum(vector<int>& nums, int target) {. vector<int> answer;. for(int i =0;i<nums.si
(還有204個字)