You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -138,12 +138,14 @@ Remember solutions are only solutions to given problems. If you want full study
138
138
| 453 |[Number of Segments in a String](https://leetcode.com/problems/minimum-moves-to-equal-array-elements/description/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/453_Minimum_Moves_to_Equal_Array_Elements.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/453_Minimum_Moves_to_Equal_Array_Elements.java)| Each move is equal to minus one element in array, so the answer is the sum of all elements after minus min. |
139
139
| 461 |[Hamming Distance](https://leetcode.com/problems/hamming-distance/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/461_Hamming_Distance.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/461_Hamming_Distance.java)| Hamming Distance is related to XOR for numbers. So, XOR then count 1. O(n) |
140
140
| 463 |[Island Perimeter](https://leetcode.com/problems/island-perimeter/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/463_Island_Perimeter.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/463_Island_Perimeter.java)| math, find the area, actual number, then find the digit |
141
+
| 482 |[License Key Formatting](https://leetcode.com/problems/license-key-formatting/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/482_License_Key_Formatting.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/482_License_Key_Formatting.java)| String processing, lower and len % K, O(n) and O(n) |
141
142
| 538 |[Convert BST to Greater Tree](https://leetcode.com/problems/convert-bst-to-greater-tree/description/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/538_Convert_BST_to_Greater_Tree.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/538_Convert_BST_to_Greater_Tree.java)| Right first DFS with a variable recording sum of node.val and right.val. 1. Recursive.<br>2. Stack 3. Reverse Morris In-order Traversal |
142
143
| 543 |[Diameter of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/description/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/543_Diameter_of_Binary_Tree.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/543_Diameter_of_Binary_Tree.java)| DFS with O(1) for max answer |
143
144
| 572 |[Subtree of Another Tree](https://leetcode.com/problems/subtree-of-another-tree/description/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/572_Subtree_of_Another_Tree.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/572_Subtree_of_Another_Tree.java)| 1. Tree traverse and compare<br>2. Tree to string and compare |
144
145
| 581 |[Shortest Unsorted Continuous Subarray](https://leetcode.com/problems/subtree-of-another-tree/description/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/581_Shortest_Unsorted_Continuous_Subarray.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/581_Shortest_Unsorted_Continuous_Subarray.java)| 1. Sort and find the difference (min and max), O(nlgn)<br>2. Using stack to find boundaries (push when correct order, pop when not correct), O(n) and O(n)<br>3. Find min and max of unordered array, O(n) and O(1)|
145
146
| 617 |[Merge Two Binary Trees](https://leetcode.com/problems/merge-two-binary-trees/description/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/617_Merge_Two_Binary_Trees.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/617_Merge_Two_Binary_Trees.java)| Traverse both trees Recursion & Iterative (stack) |
| 709 |[To Lower Case](https://leetcode.com/problems/to-lower-case/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/709_To_Lower_Case.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/709_To_Lower_Case.java)| String processing:<br>1. str.lower() or str.toLowerCase()<br>2. ASCII processing. O(n) and O(1) |
147
149
| 716 |[Max Stack](https://leetcode.com/problems/max-stack/)♥|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/716_Max_Stack.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/716_Max_Stack.java)| 1. Two stacks<br> 2. Double linked list and Hash |
148
150
| 771 |[Jewels and Stones](https://leetcode.com/problems/jewels-and-stones/description/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/771_Jewels_and_Stones.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/771_Jewels_and_Stones.java)| Count given char in string. Hash or table. [Oneline](https://leetcode.com/problems/jewels-and-stones/discuss/113574/1-liners-PythonJavaRuby)|
149
151
| 804 |[Unique Morse Code Words](https://leetcode.com/problems/unique-morse-code-words/description/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/804_Unique_Morse_Code_Words.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/804_Unique_Morse_Code_Words.java)| String, Hash and Set. Set is recommended. |
0 commit comments