摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example Given 1->2->3- 阅读全文
posted @ 2016-04-04 17:29 哥布林工程师 阅读(151) 评论(0) 推荐(0)
摘要: The size of the hash table is not determinate at the very beginning. If the total size of keys is too large (e.g. size >= capacity / 10), we should do 阅读全文
posted @ 2016-04-04 16:15 哥布林工程师 阅读(145) 评论(0) 推荐(0)
摘要: Print numbers from 1 to the largest number with N digits by recursion. Notice It's pretty easy to do recursion like: recursion(i) { if i > largest num 阅读全文
posted @ 2016-04-04 15:54 哥布林工程师 阅读(211) 评论(0) 推荐(0)
摘要: Given a list of integers, which denote a permutation. Find the previous permutation in ascending order. Notice The list may contains duplicate integer 阅读全文
posted @ 2016-04-04 15:37 哥布林工程师 阅读(188) 评论(0) 推荐(0)
摘要: Implement pow(x, n). Notice You don't need to care about the precision of your answer, it's acceptable if the expected answer and your answer 's diffe 阅读全文
posted @ 2016-04-04 14:47 哥布林工程师 阅读(161) 评论(0) 推荐(0)
摘要: Given a list of numbers with duplicate number in it. Find all unique permutations. Example For numbers [1,2,2] the unique permutations are: [ [1,2,2], 阅读全文
posted @ 2016-04-04 14:42 哥布林工程师 阅读(153) 评论(0) 推荐(0)
摘要: Given a list of numbers, return all possible permutations. Example For nums = [1,2,3], the permutations are: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3, 阅读全文
posted @ 2016-04-04 13:50 哥布林工程师 阅读(145) 评论(0) 推荐(0)
摘要: Given n and k, return the k-th permutation sequence. Notice n will be between 1 and 9 inclusive. n will be between 1 and 9 inclusive. n will be betwee 阅读全文
posted @ 2016-04-04 13:41 哥布林工程师 阅读(136) 评论(0) 推荐(0)
摘要: Given a permutation which may contain repeated numbers, find its index in all the permutations of these numbers, which are ordered in lexicographical 阅读全文
posted @ 2016-04-04 13:16 哥布林工程师 阅读(187) 评论(0) 推荐(0)
摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example Given n = 12, retu 阅读全文
posted @ 2016-04-04 10:25 哥布林工程师 阅读(140) 评论(0) 推荐(0)