摘要:
After the API changes 注意没有append(0, s.charAt(i)), 是sb.insert(0, charAt(i)); 阅读全文
摘要:
it's easy to find that power of 4 numbers have those 3 common features. First,greater than 0. Second,only have one '1' bit in their binary notation,so 阅读全文
摘要:
https://discuss.leetcode.com/topic/39834/step-by-step-tackling-of-the-problem rob(root) which will return the maximum amount of money that we can rob 阅读全文
摘要:
Hint: 阅读全文
摘要:
Naive Solution: Time: O(n^2*k) with n the total number of words in the "words" array and k the average length of each word: check each combination see 阅读全文
摘要:
4th line may cross with 1st line, and so on: 5th with 2nd, ...etc 5th line may cross with 1st line, and so on: 6th with 2nd, ...etc 6th line also may 阅读全文
摘要:
Naive Solution: use DP, Time O(N^2), Space O(N) dp[i] represents the length of longest increasing subsequence till i including element i in nums array 阅读全文