摘要: 1.题目描述 6174猜想 ,1955年,卡普耶卡(D.R.Kaprekar)研究了对四位数的一种变换:任给出四位数k0,用它的四个数字由大到小重新排列成一个四位数m,再减去它的反序数rev(m),得出数k1=m-rev(m),然后,继续对k1重复上述变换,得数k2.如此进行下去,卡普耶卡发现,无论 阅读全文
posted @ 2018-03-06 21:42 vlice 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 1.题目分析 Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are fil 阅读全文
posted @ 2018-03-01 23:03 vlice 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime c 阅读全文
posted @ 2018-03-01 22:55 vlice 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not 阅读全文
posted @ 2018-02-28 23:30 vlice 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 不使用乘除法的情况下作除法,溢出的话返回MAX-INT。 2. 阅读全文
posted @ 2018-02-28 23:06 vlice 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 给定n对括号,编写一个函数来生成格式正确的括号的所有组合。 2.题目分析 采用 阅读全文
posted @ 2018-02-27 21:58 vlice 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the arr 阅读全文
posted @ 2018-02-27 21:45 vlice 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given a linked list, remove the nth node from the end of list and return its head. 删除链表中倒数第n个节点 For example, Given linked list: 1->2->3->4->5, 阅读全文
posted @ 2018-02-26 23:30 vlice 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the 阅读全文
posted @ 2018-02-26 22:41 vlice 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1.题目描述 Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three in 阅读全文
posted @ 2018-02-25 21:44 vlice 阅读(129) 评论(0) 推荐(0) 编辑