摘要: We can use bfs to solve this problem; By traverse the prerequisites array, we can generate two graph representations. One is an array of list of out n 阅读全文
posted @ 2016-02-23 07:31 爱推理的骑士 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Use two pointer to find the minimum subarray size; At first, we find the shortest subarray from the first element of which the sum is greater than or 阅读全文
posted @ 2016-02-23 04:58 爱推理的骑士 阅读(137) 评论(0) 推荐(0) 编辑