Skip to content

Commit 6590fbf

Browse files
version 2021
1 parent b5d32af commit 6590fbf

File tree

20 files changed

+1841
-41
lines changed

20 files changed

+1841
-41
lines changed

level-2/leetcode-phase-2-1/README.md

Lines changed: 256 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

level-2/leetcode-phase-2-2/README.md

Lines changed: 222 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

level-2/leetcode-phase-2-3/README.md

Lines changed: 239 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

level-2/leetcode-phase-2-4/README.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
<img align="right" width="80" height="80" src="https://github.com/cs-MohamedAyman/Problem-Solving-Training/blob/master/online-judges-logos/leetcode.jpg">
2+
3+
## [LeetCode](https://leetcode.com/) OJ - Phase 2.4 `130 problems` `80 hrs`
4+
5+
### Table of Content
6+
7+
- ***Binary Tree I*** `30 problems`
8+
- ***Binary Tree II*** `30 problems`
9+
- ***Binary Tree III*** `30 problems`
10+
- ***Heap Tree*** `30 problems`
11+
- ***Hash Table*** `10 problems`
12+
13+
## LeetCode - Binary Tree I `30 problems`
14+
15+
- [deepest leaves sum](https://leetcode.com/problems/deepest-leaves-sum/)
16+
- [sum of nodes with even valued grandparent](https://leetcode.com/problems/sum-of-nodes-with-even-valued-grandparent/)
17+
- [clone n ary tree](https://leetcode.com/problems/clone-n-ary-tree/)
18+
- [maximum binary tree](https://leetcode.com/problems/maximum-binary-tree/)
19+
- [design an expression tree with evaluate function](https://leetcode.com/problems/design-an-expression-tree-with-evaluate-function/)
20+
- [clone binary tree with random pointer](https://leetcode.com/problems/clone-binary-tree-with-random-pointer/)
21+
- [lowest common ancestor of a binary tree iv](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iv/)
22+
- [construct binary search tree from preorder traversal](https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal/)
23+
- [all elements in two binary search trees](https://leetcode.com/problems/all-elements-in-two-binary-search-trees/)
24+
- [lowest common ancestor of a binary tree iii](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iii/)
25+
- [correct a binary tree](https://leetcode.com/problems/correct-a-binary-tree/)
26+
- [insert into a binary search tree](https://leetcode.com/problems/insert-into-a-binary-search-tree/)
27+
- [find elements in a contaminated binary tree](https://leetcode.com/problems/find-elements-in-a-contaminated-binary-tree/)
28+
- [delete leaves with a given value](https://leetcode.com/problems/delete-leaves-with-a-given-value/)
29+
- [path in zigzag labelled binary tree](https://leetcode.com/problems/path-in-zigzag-labelled-binary-tree/)
30+
- [find nearest right node in binary tree](https://leetcode.com/problems/find-nearest-right-node-in-binary-tree/)
31+
- [find leaves of binary tree](https://leetcode.com/problems/find-leaves-of-binary-tree/)
32+
- [count good nodes in binary tree](https://leetcode.com/problems/count-good-nodes-in-binary-tree/)
33+
- [binary tree pruning](https://leetcode.com/problems/binary-tree-pruning/)
34+
- [distribute coins in binary tree](https://leetcode.com/problems/distribute-coins-in-binary-tree/)
35+
- [maximum difference between node and ancestor](https://leetcode.com/problems/maximum-difference-between-node-and-ancestor/)
36+
- [check if two expression trees are equivalent](https://leetcode.com/problems/check-if-two-expression-trees-are-equivalent/)
37+
- [pseudo palindromic paths in a binary tree](https://leetcode.com/problems/pseudo-palindromic-paths-in-a-binary-tree/)
38+
- [change the root of a binary tree](https://leetcode.com/problems/change-the-root-of-a-binary-tree/)
39+
- [maximum level sum of a binary tree](https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/)
40+
- [find distance in a binary tree](https://leetcode.com/problems/find-distance-in-a-binary-tree/)
41+
- [lowest common ancestor of deepest leaves](https://leetcode.com/problems/lowest-common-ancestor-of-deepest-leaves/)
42+
- [construct binary tree from preorder and postorder traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/)
43+
- [delete nodes and return forest](https://leetcode.com/problems/delete-nodes-and-return-forest/)
44+
- [n ary tree level order traversal](https://leetcode.com/problems/n-ary-tree-level-order-traversal/)
45+
- [binary search tree iterator ii](https://leetcode.com/problems/binary-search-tree-iterator-ii/)
46+
- [flip equivalent binary trees](https://leetcode.com/problems/flip-equivalent-binary-trees/)
47+
- [maximum binary tree ii](https://leetcode.com/problems/maximum-binary-tree-ii/)
48+
49+
## LeetCode - Binary Tree II `30 problems`
50+
51+
- [maximum average subtree](https://leetcode.com/problems/maximum-average-subtree/)
52+
- [kth smallest element in a bst](https://leetcode.com/problems/kth-smallest-element-in-a-bst/)
53+
- [find bottom left tree value](https://leetcode.com/problems/find-bottom-left-tree-value/)
54+
- [find largest value in each tree row](https://leetcode.com/problems/find-largest-value-in-each-tree-row/)
55+
- [reorder routes to make all paths lead to the city zero](https://leetcode.com/problems/reorder-routes-to-make-all-paths-lead-to-the-city-zero/)
56+
- [tree diameter](https://leetcode.com/problems/tree-diameter/)
57+
- [smallest common region](https://leetcode.com/problems/smallest-common-region/)
58+
- [throne inheritance](https://leetcode.com/problems/throne-inheritance/)
59+
- [inorder successor in bst ii](https://leetcode.com/problems/inorder-successor-in-bst-ii/)
60+
- [most frequent subtree sum](https://leetcode.com/problems/most-frequent-subtree-sum/)
61+
- [redundant connection](https://leetcode.com/problems/redundant-connection/)
62+
- [complete binary tree inserter](https://leetcode.com/problems/complete-binary-tree-inserter/)
63+
- [all nodes distance k in binary tree](https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/)
64+
- [binary tree level order traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/)
65+
- [path sum iv](https://leetcode.com/problems/path-sum-iv/)
66+
- [number of good leaf nodes pairs](https://leetcode.com/problems/number-of-good-leaf-nodes-pairs/)
67+
- [binary tree upside down](https://leetcode.com/problems/binary-tree-upside-down/)
68+
- [print binary tree](https://leetcode.com/problems/print-binary-tree/)
69+
- [lowest common ancestor of a binary tree ii](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-ii/)
70+
- [binary tree level order traversal ii](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/)
71+
- [longest zigzag path in a binary tree](https://leetcode.com/problems/longest-zigzag-path-in-a-binary-tree/)
72+
- [unique binary search trees](https://leetcode.com/problems/unique-binary-search-trees/)
73+
- [serialize and deserialize bst](https://leetcode.com/problems/serialize-and-deserialize-bst/)
74+
- [minimum time to collect all apples in a tree](https://leetcode.com/problems/minimum-time-to-collect-all-apples-in-a-tree/)
75+
- [count univalue subtrees](https://leetcode.com/problems/count-univalue-subtrees/)
76+
- [flatten binary tree to linked list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/)
77+
- [find duplicate subtrees](https://leetcode.com/problems/find-duplicate-subtrees/)
78+
- [add one row to tree](https://leetcode.com/problems/add-one-row-to-tree/)
79+
- [construct binary tree from preorder and inorder traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)
80+
- [construct binary tree from string](https://leetcode.com/problems/construct-binary-tree-from-string/)
81+
- [check completeness of a binary tree](https://leetcode.com/problems/check-completeness-of-a-binary-tree/)
82+
- [house robber iii](https://leetcode.com/problems/house-robber-iii/)
83+
- [even odd tree](https://leetcode.com/problems/even-odd-tree/)
84+
- [sum root to leaf numbers](https://leetcode.com/problems/sum-root-to-leaf-numbers/)
85+
- [binary tree coloring game](https://leetcode.com/problems/binary-tree-coloring-game/)
86+
- [construct binary tree from inorder and postorder traversal](https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/)
87+
- [populating next right pointers in each node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/)
88+
89+
## LeetCode - Binary Tree III `30 problems`
90+
91+
- [count complete tree nodes](https://leetcode.com/problems/count-complete-tree-nodes/)
92+
- [path sum ii](https://leetcode.com/problems/path-sum-ii/)
93+
- [lowest common ancestor of a binary tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/)
94+
- [flip binary tree to match preorder traversal](https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/)
95+
- [path sum iii](https://leetcode.com/problems/path-sum-iii/)
96+
- [binary tree longest consecutive sequence](https://leetcode.com/problems/binary-tree-longest-consecutive-sequence/)
97+
- [binary tree longest consecutive sequence ii](https://leetcode.com/problems/binary-tree-longest-consecutive-sequence-ii/)
98+
- [smallest string starting from leaf](https://leetcode.com/problems/smallest-string-starting-from-leaf/)
99+
- [delete node in a bst](https://leetcode.com/problems/delete-node-in-a-bst/)
100+
- [check if a string is a valid sequence from root to leaves path in a binary tree](https://leetcode.com/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/)
101+
- [closest leaf in a binary tree](https://leetcode.com/problems/closest-leaf-in-a-binary-tree/)
102+
- [inorder successor in bst](https://leetcode.com/problems/inorder-successor-in-bst/)
103+
- [unique binary search trees ii](https://leetcode.com/problems/unique-binary-search-trees-ii/)
104+
- [recover binary search tree](https://leetcode.com/problems/recover-binary-search-tree/)
105+
- [populating next right pointers in each node ii](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/)
106+
- [boundary of binary tree](https://leetcode.com/problems/boundary-of-binary-tree/)
107+
- [equal tree partition](https://leetcode.com/problems/equal-tree-partition/)
108+
- [maximum width of binary tree](https://leetcode.com/problems/maximum-width-of-binary-tree/)
109+
- [largest bst subtree](https://leetcode.com/problems/largest-bst-subtree/)
110+
- [maximum product of splitted binary tree](https://leetcode.com/problems/maximum-product-of-splitted-binary-tree/)
111+
- [encode n ary tree to binary tree](https://leetcode.com/problems/encode-n-ary-tree-to-binary-tree/)
112+
- [recover a tree from preorder traversal](https://leetcode.com/problems/recover-a-tree-from-preorder-traversal/)
113+
- [move sub tree of n ary tree](https://leetcode.com/problems/move-sub-tree-of-n-ary-tree/)
114+
- [serialize and deserialize n ary tree](https://leetcode.com/problems/serialize-and-deserialize-n-ary-tree/)
115+
- [build binary expression tree from infix expression](https://leetcode.com/problems/build-binary-expression-tree-from-infix-expression/)
116+
- [serialize and deserialize binary tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/)
117+
- [sum of distances in tree](https://leetcode.com/problems/sum-of-distances-in-tree/)
118+
- [binary tree cameras](https://leetcode.com/problems/binary-tree-cameras/)
119+
- [number of ways to reconstruct a tree](https://leetcode.com/problems/number-of-ways-to-reconstruct-a-tree/)
120+
- [vertical order traversal of a binary tree](https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/)
121+
- [tree of coprimes](https://leetcode.com/problems/tree-of-coprimes/)
122+
- [redundant connection ii](https://leetcode.com/problems/redundant-connection-ii/)
123+
124+
## LeetCode - Heap Tree `30 problems`
125+
126+
- [employee free time](https://leetcode.com/problems/employee-free-time/)
127+
- [find the kth smallest sum of a matrix with sorted rows](https://leetcode.com/problems/find-the-kth-smallest-sum-of-a-matrix-with-sorted-rows/)
128+
- [swim in rising water](https://leetcode.com/problems/swim-in-rising-water/)
129+
- [minimum cost to hire k workers](https://leetcode.com/problems/minimum-cost-to-hire-k-workers/)
130+
- [minimize deviation in array](https://leetcode.com/problems/minimize-deviation-in-array/)
131+
- [find median from data stream](https://leetcode.com/problems/find-median-from-data-stream/)
132+
- [trapping rain water ii](https://leetcode.com/problems/trapping-rain-water-ii/)
133+
- [k th smallest prime fraction](https://leetcode.com/problems/k-th-smallest-prime-fraction/)
134+
- [merge k sorted lists](https://leetcode.com/problems/merge-k-sorted-lists/)
135+
- [reachable nodes in subdivided graph](https://leetcode.com/problems/reachable-nodes-in-subdivided-graph/)
136+
- [shortest path to get all keys](https://leetcode.com/problems/shortest-path-to-get-all-keys/)
137+
- [ipo](https://leetcode.com/problems/ipo/)
138+
- [race car](https://leetcode.com/problems/race-car/)
139+
- [the skyline problem](https://leetcode.com/problems/the-skyline-problem/)
140+
- [rearrange string k distance apart](https://leetcode.com/problems/rearrange-string-k-distance-apart/)
141+
- [find k th smallest pair distance](https://leetcode.com/problems/find-k-th-smallest-pair-distance/)
142+
- [minimum number of refueling stops](https://leetcode.com/problems/minimum-number-of-refueling-stops/)
143+
- [hand of straights](https://leetcode.com/problems/hand-of-straights/)
144+
- [my calendar ii](https://leetcode.com/problems/my-calendar-ii/)
145+
- [exam room](https://leetcode.com/problems/exam-room/)
146+
- [alert using same key card three or more times in a one hour period](https://leetcode.com/problems/alert-using-same-key-card-three-or-more-times-in-a-one-hour-period/)
147+
- [contains duplicate iii](https://leetcode.com/problems/contains-duplicate-iii/)
148+
- [my calendar iii](https://leetcode.com/problems/my-calendar-iii/)
149+
- [data stream as disjoint intervals](https://leetcode.com/problems/data-stream-as-disjoint-intervals/)
150+
- [falling squares](https://leetcode.com/problems/falling-squares/)
151+
- [range module](https://leetcode.com/problems/range-module/)
152+
- [find servers that handled most number of requests](https://leetcode.com/problems/find-servers-that-handled-most-number-of-requests/)
153+
- [create sorted array through instructions](https://leetcode.com/problems/create-sorted-array-through-instructions/)
154+
- [k empty slots](https://leetcode.com/problems/k-empty-slots/)
155+
- [number of distinct substrings in a string](https://leetcode.com/problems/number-of-distinct-substrings-in-a-string/)
156+
- [longest chunked palindrome decomposition](https://leetcode.com/problems/longest-chunked-palindrome-decomposition/)
157+
- [distinct echo substrings](https://leetcode.com/problems/distinct-echo-substrings/)
158+
159+
## LeetCode - Hash Table `10 problems`
160+
161+
- [smallest range covering elements from k lists](https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/)
162+
- [number of distinct islands ii](https://leetcode.com/problems/number-of-distinct-islands-ii/)
163+
- [sudoku solver](https://leetcode.com/problems/sudoku-solver/)
164+
- [number of valid words for each puzzle](https://leetcode.com/problems/number-of-valid-words-for-each-puzzle/)
165+
- [grid illumination](https://leetcode.com/problems/grid-illumination/)
166+
- [maximum equal frequency](https://leetcode.com/problems/maximum-equal-frequency/)
167+
- [palindrome pairs](https://leetcode.com/problems/palindrome-pairs/)
168+
- [insert delete getrandom o1 duplicates allowed](https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed/)
169+
- [random pick with blacklist](https://leetcode.com/problems/random-pick-with-blacklist/)
170+
- [longest duplicate substring](https://leetcode.com/problems/longest-duplicate-substring/)
171+
- [substring with concatenation of all words](https://leetcode.com/problems/substring-with-concatenation-of-all-words/)
172+
- [max points on a line](https://leetcode.com/problems/max-points-on-a-line/)
Binary file not shown.

level-2/leetcode-phase-2-array-and-linked-list/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

level-2/leetcode-phase-2-binary-tree/README.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)