29 Aug

## Solution to Happy Number by LeetCode

29 Aug

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

## Solution to Bitwise AND of Numbers Range by LeetCode

23 Aug

Question: https://leetcode.com/problems/bitwise-and-of-numbers-range/ Question Name: Bitwise AND of Numbers Range A variant of number of 1 bits in an interger. For any non-zero interger 0b?????????1000 (? could be 1 or 0, and there are zero or one or more 0s after … Read More »

## 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.