上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 50 下一页
摘要: Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Note: Given target value is a floati 阅读全文
posted @ 2018-03-24 09:30 轻风舞动 阅读(781) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges mak 阅读全文
posted @ 2018-03-24 08:44 轻风舞动 阅读(3089) 评论(0) 推荐(0) 编辑
摘要: Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t 阅读全文
posted @ 2018-03-24 07:33 轻风舞动 阅读(720) 评论(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 @ 2018-03-24 06:47 轻风舞动 阅读(604) 评论(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 @ 2018-03-24 06:43 轻风舞动 阅读(556) 评论(0) 推荐(0) 编辑
摘要: 转自: only_on_one 前天参加58集团笔试,最后的问答题有一道这样的题,事后推敲后觉得很有意思,就记录下来吧。 给定100个乒乓球,甲乙两人轮流拿,每人每次最少拿1个,最多拿6个,问有没有必胜的拿法,如有,哪方必胜? 答:有必胜的方法,先拿的必胜。通过列举法找到规律: 从上述规律可以看出, 阅读全文
posted @ 2018-03-24 05:03 轻风舞动 阅读(1288) 评论(0) 推荐(0) 编辑
摘要: 我写的Python代码: class Solution(object): def getNumberGame(self, n, nums): m = len(nums) dp = [[0] * m for j in xrange(m)] for i in xrange(m): dp[i][i] = 阅读全文
posted @ 2018-03-24 01:54 轻风舞动 阅读(657) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if a permutation of the string could form a palindrome. For example,"code" -> False, "aab" -> True, "carerac" -> True. Hint: 阅读全文
posted @ 2018-03-23 11:46 轻风舞动 阅读(555) 评论(0) 推荐(0) 编辑
摘要: Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form 阅读全文
posted @ 2018-03-23 11:44 轻风舞动 阅读(846) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -- 阅读全文
posted @ 2018-03-23 09:29 轻风舞动 阅读(488) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 50 下一页