摘要:
Another Two Sum java class Solution { public int subarraysDivByK(int[] A, int K) { int[] sum = new int[A.length + 1]; for (int i = 0; i c = new HashMa 阅读全文
摘要:
technically, no different with two sum 阅读全文
摘要:
This remains me of some 'subarray count' type problems….. 阅读全文
摘要:
Prefix product or two pointer can both solve this problem. But don't forget to take a look at the note 阅读全文
摘要:
prefix sum k = 0 is a corner case, in which case just save , not And every time, record the leftmost index of a key.(greedy) 阅读全文
摘要:
Use prefix product(sum? actually much the same). 阅读全文
摘要:
using sliding window And try to Using prefix sum method, the rightmost index with value = s ? 1: N + 1; for (int i = 1; i target) { ret = Math.min(ret 阅读全文
摘要:
O(N) space and O(M N) time solution, where M, N is A's row number and column number java class Solution { public int minFallingPathSum(int[][] A) { in 阅读全文
摘要:
Divide and conquer I'm not so good at this kind of problem, so I just checked the solution page. 阅读全文
摘要:
```java class RecentCounter { Queue q; public RecentCounter() { q = new LinkedList(); } public int ping(int t) { int threshold = t 3000; while (q.size 阅读全文