2017年12月26日

permutations(全排列)

摘要: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: 这题是列举所有情况,回溯。 每次都是从头开始遍 阅读全文

posted @ 2017-12-26 22:10 夜的第八章 阅读(313) 评论(0) 推荐(0) 编辑

Next Permutation 下一个排列

摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文

posted @ 2017-12-26 21:24 夜的第八章 阅读(137) 评论(0) 推荐(0) 编辑

search in rotated sorted array

摘要: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You a 阅读全文

posted @ 2017-12-26 19:41 夜的第八章 阅读(136) 评论(0) 推荐(0) 编辑

valid sudoku(数独)

摘要: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled wit 阅读全文

posted @ 2017-12-26 17:09 夜的第八章 阅读(248) 评论(0) 推荐(0) 编辑

combination sum II

摘要: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each num 阅读全文

posted @ 2017-12-26 13:17 夜的第八章 阅读(151) 评论(0) 推荐(0) 编辑

Combination sum

摘要: Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums 阅读全文

posted @ 2017-12-26 11:01 夜的第八章 阅读(160) 评论(0) 推荐(0) 编辑

导航