https://leetcode-cn.com/problems/sliding-window-maximum/[https://leetcode-cn.com/proble...
https://leetcode-cn.com/problems/sliding-window-maximum/[https://leetcode-cn.com/proble...
https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/[https://leetcode...
https://leetcode-cn.com/problems/binary-tree-maximum-path-sum/[https://leetcode-cn.com/...
88. 合并兩個有序數(shù)組[https://leetcode-cn.com/problems/merge-sorted-array/] 這個竟然寫不過,各種邊界條件弄不對聋袋⊙希看看...
https://leetcode-cn.com/problems/binary-tree-right-side-view/[https://leetcode-cn.com/p...
https://leetcode-cn.com/problems/largest-rectangle-in-histogram/[https://leetcode-cn.co...
https://leetcode-cn.com/problems/generate-parentheses/[https://leetcode-cn.com/problems...
https://leetcode-cn.com/problems/maximum-subarray/[https://leetcode-cn.com/problems/max...
https://leetcode-cn.com/problems/longest-increasing-subsequence/[https://leetcode-cn.co...
題目描述 https://leetcode-cn.com/problems/unique-binary-search-trees/ 代碼 是個dp哦,自己獨立寫出來的氢惋,找到了...
題目描述 https://leetcode-cn.com/problems/distribute-coins-in-binary-tree/ 思路 這個思路我沒想出來洞翩,喵了一...
題目描述 https://leetcode-cn.com/problems/unique-paths/ 思路 我看到這個題一下子想到的思路是組合數(shù),這不就是初中數(shù)學的填空題嘛...
題目描述 98. 驗證二叉搜索樹[https://leetcode-cn.com/problems/validate-binary-search-tree/] 思路 這個題思...
題目描述 409. 最長回文串 思路 題目不難焰望,就是所有的坑我都踩進去了骚亿。"abccccdd" -> a: 1, b:1, d:2, c:4我的思路是 偶數(shù)個數(shù)的直接相加,然...
題目 11. 盛最多水的容器 思路 我一開始寫的暴力熊赖,時間復雜度O(n2)的那種来屠,超時。原來可以O(shè)(n)解決的震鹉。直接看答案的思路:https://leetcode-cn.co...
題目 322. 零錢兌換 思路 參考鏈接舉個例子吧俱笛,coins = [1,3,5], amount = 11。使用最少數(shù)目的硬幣湊夠11元(用函數(shù)F(11)表示)传趾,有三種方案...
題目描述 https://leetcode-cn.com/problems/binary-tree-paths/ 思路 回溯第一題~~~~果然腦子轉(zhuǎn)不過彎迎膜,但是呢呢給講了下我...
首先來復習一下三種遍歷方式 所謂二叉樹的遍歷,是指按照一定的搜索路徑將樹的所有結(jié)點訪問且僅訪問一次浆兰。按照根結(jié)點何時被訪問磕仅,可以分為先序、中序和后序三種遍歷算法.主要區(qū)別在于 ...
題目描述 https://leetcode-cn.com/problems/symmetric-tree/ 思路 遞歸的難點在于:找到可以遞歸的點 為什么很多人覺得遞歸一看就...