Solution to Remove Linked List Elements by LeetCode

29 Aug

Question: https://leetcode.com/problems/remove-linked-list-elements/ Question Name: Remove Linked List Elements

Solution to Happy Number by LeetCode

29 Aug

Question: https://leetcode.com/problems/happy-number/ Question Name: Happy Number

Solution to Number of Islands by LeetCode

31 Jul

Question: https://leetcode.com/problems/number-of-islands/ Question Name: Number of Islands A variant of weighted quick union.

Solution to Binary Tree Right Side View by LeetCode

18 Jun

Question: https://leetcode.com/problems/binary-tree-right-side-view/ Question Name: Binary Tree Right Side View A variant of level order tree traversal.

Solution to House Robber by LeetCode

18 Jun

Question: https://leetcode.com/problems/house-robber/ Question Name: House Robber Simple DP problem. If you want, you could improve the space complexity to O(1) with bookkeeping (the second previous house, the previous house, and the current house).

Solution to Number of 1 Bits by LeetCode

1 Jun

Question: https://leetcode.com/problems/number-of-1-bits/ Question Name: Number of 1 Bits The key is how to find and remove the last 1-bit.

Solution to Reverse Bits by LeetCode

1 Jun

Question: https://leetcode.com/problems/reverse-bits/ Question Name: Reverse Bits Exactly same challege from Elements of Programming Interviews.

Solution to Rotate Array by LeetCode

28 May

Question: https://leetcode.com/problems/rotate-array/ Question Name: Rotate Array Classic Doug McIlroy’s Handwaving. It is very similar with some previous question.

Solution to Best Time to Buy and Sell Stock IV by LeetCode

25 May

Question: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/ Question Name: Best Time to Buy and Sell Stock IV Thanks to genius solution from @yishiluo.