摘要:
sum[i..j] = sum[0..j] - sum[0..i-1]. We use a hashmap to check a previous matching index with a given number.class Solution {public: vector subarra... 阅读全文
摘要:
Sorting is a natural solution. But, you don't have to run O(nlgn) sorting for all the time. Counting sort is O(n)!class Solution {public: int hInde... 阅读全文