摘要: Given an unsorted integer array, find the first missing positive integer. Your algorithm should run in O(n) time and uses constant space. 阅读全文
posted @ 2017-05-11 17:53 JeffNice 阅读(207) 评论(0) 推荐(0)
摘要: 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 number in C may only be used once in the combination. Note: * All numbers (including target) will be positive integers. * The solution set must not contain duplicate combinations. 阅读全文
posted @ 2017-05-11 17:18 JeffNice 阅读(129) 评论(0) 推荐(0)
摘要: 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 to T. The same repeated number may be chosen from C unlimited number of times. Note: * All numbers (including target) will be positive integers. * The solution set must not contain duplicate combinations. 阅读全文
posted @ 2017-05-11 16:59 JeffNice 阅读(218) 评论(0) 推荐(0)
摘要: The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "one 2, then one 1" or 1211. Given an integer n, generate the nth sequence. Note: The sequence of integers will be represented as a string. 阅读全文
posted @ 2017-05-11 16:02 JeffNice 阅读(339) 评论(0) 推荐(0)
摘要: Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character '.'. You may assume that there will be only one unique solution. 阅读全文
posted @ 2017-05-11 15:38 JeffNice 阅读(265) 评论(0) 推荐(0)