上一页 1 2 3 4 5 6 7 8 ··· 15 下一页
摘要: The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order,We get the following sequence 阅读全文
posted @ 2016-10-09 06:05 Machelsky 阅读(99) 评论(0) 推荐(0)
摘要: We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
posted @ 2016-10-09 04:35 Machelsky 阅读(160) 评论(0) 推荐(0)
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. Given a singly linked list where element 阅读全文
posted @ 2016-10-09 03:48 Machelsky 阅读(137) 评论(0) 推荐(0)
摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文
posted @ 2016-10-09 03:36 Machelsky 阅读(119) 评论(0) 推荐(0)
摘要: 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 integers. 阅读全文
posted @ 2016-10-09 03:26 Machelsky 阅读(141) 评论(0) 推荐(0)
摘要: Given a list, rotate the list to the right by k places, where k is non-negative. For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3- 阅读全文
posted @ 2016-10-09 03:02 Machelsky 阅读(129) 评论(0) 推荐(0)
摘要: 190. Reverse Bits:原数向右移动,如果bit是1,就给结果在相应的位置加上1. 46. Permutations:最适合这道题的dfs搜索顺序是把加一个限制条件:搜索过的数字跳过。脑子里面有个tree的模型然后去想应该搜索的顺序和条件。 100. Same Tree: 递归:检查是不 阅读全文
posted @ 2016-10-09 02:34 Machelsky 阅读(83) 评论(0) 推荐(0)
摘要: 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 total num 阅读全文
posted @ 2016-10-09 02:25 Machelsky 阅读(139) 评论(0) 推荐(0)
摘要: Description: Count the number of prime numbers less than a non-negative number, n. 刷了一周的python, 希望明天把blackjack和最后的游戏做出来。 思路: 比较巧妙,用inner loop从头开始mark不 阅读全文
posted @ 2016-10-08 17:14 Machelsky 阅读(91) 评论(0) 推荐(0)
摘要: 1. Two sum: map解决,扫一遍记录位置为key,值为剩下值。 2. Add Two Numbers: 链表扫一遍, dummy node接算出来的node,跑完一个跑另一个,最后接上多出的node1 136. Single Number: 可以用map也可以用bit manipulati 阅读全文
posted @ 2016-10-08 16:42 Machelsky 阅读(83) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 15 下一页