上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 33 下一页
摘要: 题目:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any poi... 阅读全文
posted @ 2015-09-23 11:26 Hygeia 阅读(227) 评论(0) 推荐(0) 编辑
摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文
posted @ 2015-09-23 06:20 Hygeia 阅读(170) 评论(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-09-22 23:50 Hygeia 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Update (2015-02-12):For C p... 阅读全文
posted @ 2015-09-22 23:34 Hygeia 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- Remov 阅读全文
posted @ 2015-09-17 03:49 Hygeia 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"Corner Cases:Did you ... 阅读全文
posted @ 2015-09-16 06:40 Hygeia 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题目: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in 阅读全文
posted @ 2015-09-16 05:26 Hygeia 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Q:Implementint sqrt(int x).Compute and return the square root ofx.A:这里给出两种实现方法:一是二分搜索,二是牛顿迭代法。1. 二分搜索对于一个非负数n,它的平方根不会大于(n/2+1)。在[0, n/2+1]这个范围内可以进行二分搜... 阅读全文
posted @ 2015-09-16 05:15 Hygeia 阅读(188) 评论(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-09-16 04:43 Hygeia 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + ... 阅读全文
posted @ 2015-09-11 07:44 Hygeia 阅读(99) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 33 下一页