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
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -156,8 +156,9 @@ Also, there are open source implementations for basic data structs and algorithm
156
156
| 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) |
157
157
| 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 |
158
158
| 475 |[Heaters](https://leetcode.com/problems/heaters/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/475_Heaters.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/475_Heaters.java)| 1. Binary search hourse in heater array, O(nlogn) and O(1)<br> 2. Two points, O(nlogn) and O(1) |
159
-
| 479 |[Largest Palindrome Product](https://leetcode.com/problems/largest-palindrome-product/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/479_Largest_Palindrome_Product.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/479_Largest_Palindrome_Product.java)| 1. Product max palindrome than check, O(n^2) and O(1)<br>2. [Math](# https://leetcode.com/problems/largest-palindrome-product/discuss/96305/Python-Solution-Using-Math-In-48ms)|
159
+
| 479 |[Largest Palindrome Product](https://leetcode.com/problems/largest-palindrome-product/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/479_Largest_Palindrome_Product.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/479_Largest_Palindrome_Product.java)| 1. Product max palindrome than check, O(n^2) and O(1)<br>2. [Math](https://leetcode.com/problems/largest-palindrome-product/discuss/96305/Python-Solution-Using-Math-In-48ms)|
160
160
| 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) |
161
+
| 485 |[Max Consecutive Ones](https://leetcode.com/problems/max-consecutive-ones/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/485_Max_Consecutive_Ones.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/485_Max_Consecutive_Ones.java)| Add one when encounter 1, set to 0 when encounter 0, O(n) and O(1) |
161
162
| 509 |[Fibonacci Number](https://leetcode.com/problems/fibonacci-number/)|[Python](https://github.com/qiyuangong/leetcode/blob/master/python/509_Fibonacci_Number.py)[Java](https://github.com/qiyuangong/leetcode/blob/master/java/509_Fibonacci_Number.java)| 1. Recursive, O(n) <br>2. DP with memo, O(n). Note that N<=30, which means that we can keep a memo from 0 to 30. |
162
163
| 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 |
163
164
| 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 |
0 commit comments