Date:2020/4/14
- 題目:https://leetcode-cn.com/problems/add-two-numbers-ii/ tip:利用堆疊模擬從后往前操作
- 題目:https://leetcode-cn.com/problems/sort-the-matrix-diagonally/ tip: 對角線遍歷,然后利用set插入自動排序,則獲取迭代器所指向的key是有序的,
- 題目:https://leetcode-cn.com/problems/sort-integers-by-the-power-value/ tip: 也是利用map中內部key是自動排序,所以依次遍歷到對應位置即可(一定要清楚審題)
Date:2020/4/15
- 題目:https://leetcode-cn.com/problems/validate-stack-sequences/ tip:根據pop序列來倒推push序列是否可能
- 題目:https://leetcode-cn.com/problems/01-matrix/ tip:動態規劃(四個方向) DFS和BFS(四個方向)可以多總結,
- 題目:https://leetcode-cn.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/ tip: 利用中序后序遍歷序列的特點,進行遞回構建,分好左右子樹序列,
Date:2020/4/17
- https://leetcode-cn.com/problems/open-the-lock/ tip:雙向BFS BFS模型
- 背包九講(沒咋看透 在加把油!!!)
Date: 2020/4/19
- https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ tip: 與中序和后序一樣的思路
-
https://leetcode-cn.com/problems/queens-that-can-attack-the-king/ tip:主要是構造八個方向的陣列 思路不難
- https://leetcode-cn.com/problems/balance-a-binary-search-tree/submissions/ tip:我自己重建樹,不過應該是AVL樹的建立,
Date: 2020/4/20
- https://leetcode-cn.com/problems/number-of-islands/ tip:簡單的DFS遍歷
- https://leetcode-cn.com/problems/delete-leaves-with-a-given-value/ tip:設計到二叉樹一般就是遞回
- https://leetcode-cn.com/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/ tip:簡單回溯法
Date: 2020/4/21
1.https://leetcode-cn.com/problems/max-consecutive-ones-iii/ tip:滑動視窗
2.https://leetcode-cn.com/problems/minimum-size-subarray-sum/ tip:滑動視窗
3 https://leetcode-cn.com/problems/count-number-of-nice-subarrays/ tip:滑動視窗
Date: 2020/4/22
- https://leetcode-cn.com/problems/find-all-anagrams-in-a-string/ tip:滑動視窗
- https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ tip:滑動視窗
- https://leetcode-cn.com/problems/minimum-window-substring/ tip:滑動視窗
Date:2020/4/24
1 https://leetcode-cn.com/problems/shu-zu-zhong-de-ni-xu-dui-lcof/ tip:歸并排序的應用 下同
2 https://leetcode-cn.com/problems/count-of-smaller-numbers-after-self/
3 https://leetcode-cn.com/problems/reverse-pairs/
Date:2020/4/25
1 https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/ tip:二分 下同 不過細節挺多 卒
2 https://leetcode-cn.com/problems/search-in-rotated-sorted-array/
3 https://leetcode-cn.com/problems/search-in-rotated-sorted-array-ii/
4 https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/
Date:2020/4/28
1 https://leetcode-cn.com/problems/minimum-number-of-steps-to-make-two-strings-anagram/ Tip:map解決 也可以不用直接定義個char[26]更快
2 https://leetcode-cn.com/problems/lexicographical-numbers/ Tip:利用map內部自動排序,將數字轉成字串,厲害
3 https://leetcode-cn.com/problems/find-elements-in-a-contaminated-binary-tree/ Tip:二叉樹 一般遞回解決
Date:2020/4/29
1 https://leetcode-cn.com/problems/zai-pai-xu-shu-zu-zhong-cha-zhao-shu-zi-lcof/ Tip:兩次二分
2 https://leetcode-cn.com/problems/find-in-mountain-array/ tip:二分查找分界點,然后在兩個區域分別二分
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/60075.html
標籤:其他
