上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页
摘要: Given an integer array of sizen, find all elements that appear more than⌊ n/3 ⌋times. The algorithm should run in linear time and in O(1) space.题目大意:给... 阅读全文
posted @ 2015-06-30 00:34 丶Blank 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Given a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5","7"].题目大意:给一个有... 阅读全文
posted @ 2015-06-29 22:41 丶Blank 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find out whether there are two distinct indicesiandjin the array such that the difference betweennums[i]andnums[j]is at mo... 阅读全文
posted @ 2015-06-25 15:20 丶Blank 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i... 阅读全文
posted @ 2015-06-25 13:41 丶Blank 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 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 point ... 阅读全文
posted @ 2015-06-25 13:39 丶Blank 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Implementint sqrt(int x).Compute and return the square root ofx.题目大意:实现求一个int的根。解题思路:二分。public class Solution { public int mySqrt(int x) { i... 阅读全文
posted @ 2015-06-25 13:36 丶Blank 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Given an absolute path for a file (Unix-style), simplify it.For example,path="/home/", =>"/home"path="/a/./b/../../c/", =>"/c"题目大意:给一个String,表示一个文件的绝对... 阅读全文
posted @ 2015-06-25 13:34 丶Blank 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary tree every level, except... 阅读全文
posted @ 2015-06-25 12:33 丶Blank 阅读(168) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top()... 阅读全文
posted @ 2015-06-25 11:37 丶Blank 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Description:Count the number of prime numbers less than a non-negative number,n.题目大意:给一个int,返回小于它的质数的数量。解题思路:打表。public class Solution { public ... 阅读全文
posted @ 2015-06-25 11:34 丶Blank 阅读(164) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 24 下一页