摘要:
Heap: you need to know the row number and column number of that element(so we can create a tuple class here) Binary Search方法:(12/28仔细看了之后觉得没必要深究,有时间再去 阅读全文
摘要:
DP 解法: the key to solve DP problem is to think about how to create overlap, how to re-solve subproblems(怎么制造复用) Bottom up dp: Better Solution(Bottom-u 阅读全文
摘要:
DP solution is O(N^2), better way is greedy Now for explanation, we take example series:2,1,4,5,6,3,3,4,8,4 First we check if the series is starting a 阅读全文
摘要:
Clarification of the problem: https://discuss.leetcode.com/topic/68252/clarification-on-the-problem-description-problem-description-need-to-be-updated 阅读全文
摘要:
Binary Search Here "My" means the number which is given for you to guess not the number you put into guess(int num). 阅读全文
摘要:
Better Solution: O(KlogK), 转自https://discuss.leetcode.com/topic/50885/simple-java-o-klogk-solution-with-explanation Some observations: For every numbe 阅读全文
摘要:
ab % k = (a%k)(b%k)%kSince the power here is an array, we'd better handle it digit by digit.One observation:a^1234567 % k = (a^1234560 % k) * (a^7 % k 阅读全文