摘要: Problem : Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example: 思路 : 首先弄清楚IP地址的定义。 Defin 阅读全文
posted @ 2020-02-04 10:37 littledy 阅读(90) 评论(0) 推荐(0)
摘要: Problem : Given a collection of integers that might contain duplicates, nums , return all possible subsets (the power set). Note: The solution set mus 阅读全文
posted @ 2020-02-03 23:21 littledy 阅读(87) 评论(0) 推荐(0)
摘要: Problem : The gray code is a binary numeral system where two successive values differ in only one bit. Given a non negative integer n representing the 阅读全文
posted @ 2020-02-03 10:29 littledy 阅读(118) 评论(0) 推荐(0)
摘要: Problem : Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should pre 阅读全文
posted @ 2020-02-03 09:05 littledy 阅读(83) 评论(0) 推荐(0)
摘要: Problem : Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: E 阅读全文
posted @ 2020-02-02 10:28 littledy 阅读(82) 评论(0) 推荐(0)
摘要: Problem : Given a sorted array nums, remove the duplicates in place such that duplicates appeared at most twice and return the new length. Do not allo 阅读全文
posted @ 2020-02-02 09:47 littledy 阅读(88) 评论(0) 推荐(0)
摘要: Problem : Given a set of distinct integers, nums , return all possible subsets (the power set). Note: The solution set must not contain duplicate subs 阅读全文
posted @ 2020-02-02 08:54 littledy 阅读(115) 评论(0) 推荐(0)
摘要: Problem : Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: 思路 : 这题的思路很难直接用语言表述,建议看代码,然后再纸上将其每一步运行的结果 阅读全文
posted @ 2020-02-02 07:56 littledy 阅读(79) 评论(0) 推荐(0)
摘要: Problem : Given an array with n objects colored red, white or blue, sort them in place so that objects of the same color are adjacent, with the colors 阅读全文
posted @ 2020-02-01 10:17 littledy 阅读(83) 评论(0) 推荐(0)
摘要: Problem : Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row ar 阅读全文
posted @ 2020-02-01 09:31 littledy 阅读(103) 评论(0) 推荐(0)