Fork me on GitHub
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页
摘要: 题目:Determine whether an integer is a palindrome. Do this without extra space.提示:此题需要注意负数不是回文数。另外,我一开始的思路是把输入数字通过整除和取模运算把它倒转过来与原数字进行比较(不用考虑倒转过来的数字会不会溢出... 阅读全文
posted @ 2015-08-24 13:48 __Neo 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题目:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below a... 阅读全文
posted @ 2015-08-24 11:06 __Neo 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 题目:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Have you thought about this?Here are some good questions to ... 阅读全文
posted @ 2015-08-24 10:13 __Neo 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the ... 阅读全文
posted @ 2015-08-23 19:51 __Neo 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["... 阅读全文
posted @ 2015-08-23 19:20 __Neo 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 题目:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For ex... 阅读全文
posted @ 2015-08-22 20:42 __Neo 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: P... 阅读全文
posted @ 2015-08-22 19:28 __Neo 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 题目:Description:Count the number of prime numbers less than a non-negative number,n.提示:求素数个数的比较快速的方法是“埃拉托斯特尼筛法”,其原理很简单,具体的解释可以点击该链接。代码:一个简单的“埃拉托斯特尼筛法”实... 阅读全文
posted @ 2015-08-22 18:40 __Neo 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array of strings, group anagrams together.For example, given:["eat", "tea", "tan", "ate", "nat", "bat"],Return:[ ["ate", "eat","tea"], [... 阅读全文
posted @ 2015-08-22 16:35 __Neo 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 题目:Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of... 阅读全文
posted @ 2015-08-22 12:09 __Neo 阅读(358) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页