随笔分类 -  LeetCode

摘要:Proving NP-completeness by generalization. For each of the problems below, prove that it is NP-complete by showing that it is a generalizati... 阅读全文
posted @ 2017-06-30 19:49 紫魔戒 阅读(309) 评论(0) 推荐(0)
摘要:DescriptionThere are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take c... 阅读全文
posted @ 2017-06-19 16:43 紫魔戒 阅读(150) 评论(0) 推荐(0)
摘要:DescriptionGiven an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 1... 阅读全文
posted @ 2017-05-30 20:20 紫魔戒 阅读(110) 评论(0) 推荐(0)
摘要:DescriptionGiven an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the w... 阅读全文
posted @ 2017-05-26 18:15 紫魔戒 阅读(363) 评论(0) 推荐(0)
摘要:DescriptionGiven an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Exam... 阅读全文
posted @ 2017-05-21 19:51 紫魔戒 阅读(134) 评论(0) 推荐(0)
摘要:Description In MATLAB, there is a very useful function called ‘reshape’, which can reshape a matrix into a new one with different size but keep its or 阅读全文
posted @ 2017-05-20 19:31 紫魔戒 阅读(133) 评论(0) 推荐(0)