Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2015年9月4日

摘要: 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... 阅读全文
posted @ 2015-09-04 06:02 Tonix 阅读(176) 评论(0) 推荐(0)

摘要: 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... 阅读全文
posted @ 2015-09-04 04:58 Tonix 阅读(179) 评论(0) 推荐(0)