摘要: Permutations Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2 阅读全文
posted @ 2015-09-10 15:45 Sean_le 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Missing NumberGiven an array containingndistinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.For example,Givennums=... 阅读全文
posted @ 2015-09-10 15:08 Sean_le 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Set Matrix ZeroesGiven amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.空间复杂度O(1),不能使用额外的空间,那得多重复几次。判断第一行和第一列是否有0,用于... 阅读全文
posted @ 2015-09-10 11:26 Sean_le 阅读(147) 评论(0) 推荐(0) 编辑