## Solution to Repeated DNA Sequences by LeetCode

29 Apr

Question: https://leetcode.com/problems/repeated-dna-sequences/ Question Name: Repeated DNA Sequences Simple brute force solution works.

## Solution to Largest Number by LeetCode

29 Apr

Question: https://leetcode.com/problems/largest-number/ Question Name: Largest Number Conver the input numbers into strings. And then sort the strings according to special rule.

However, if you prefer a Python3 solution:

## Solution to Dungeon Game by LeetCode

27 Apr

Question: https://leetcode.com/problems/dungeon-game/ Question Name: Dungeon Game The challenge is a DP question. Let minHPFromHere be a 2D matrix with the size of input dungeon game. minHPFromHere[i][j] is the minimum HP to rescue the princess, if the input[i][j] is the initial … Read More »

## Solution to Binary Search Tree Iterator by LeetCode

24 Apr

Question: https://leetcode.com/problems/binary-search-tree-iterator/ Question Name: Binary Search Tree Iterator The challenge is a variant of the iterative in-order traversal of BST. However, yield in python is much much better in implementing iterator, right?

## Solution to Factorial Trailing Zeroes by LeetCode

24 Apr

Question: https://leetcode.com/problems/factorial-trailing-zeroes/ Question Name: Factorial Trailing Zeroes I firstly saw this question on CTCI. The key points of the solution are: Every interger could be represented as (2^i)*(5^j)*x, where i, j >= 0 and x cannot be evenly divided by … Read More »

## Solution to Excel Sheet Column Number by LeetCode

23 Apr

Question: https://leetcode.com/problems/excel-sheet-column-number/ Question Name: Excel Sheet Column Number This tiny website is hosted on a free provider. Therefore it is not as strong as the big guys. SORRY for any inconvenience recently.

## Solution to Majority Element by LeetCode

9 Apr

Question: https://leetcode.com/problems/majority-element/ Question Name: Majority Element We can do it with a dictionary (O(N) time, O(N) space). For a better solution with O(N) time and O(1) space, we can remove pairs of different elements as many as possible, and the … Read More »

## Solution to Excel Sheet Column Title by LeetCode

9 Apr

Question: https://leetcode.com/problems/excel-sheet-column-title/ Question Name: Excel Sheet Column

## Solution to Fraction to Recurring Decimal by LeetCode

8 Apr

Question: https://leetcode.com/problems/fraction-to-recurring-decimal/ Question Name: Fraction to Recurring Decimal Again, a little mathematical puzzle. Pay attention to some corner cases.

## Solution to Compare Version Numbers by LeetCode

7 Apr

Question: https://leetcode.com/problems/compare-version-numbers/ Question Name: Compare Version Numbers Clean up the tailing 0(s), and the right answer is there.