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.public...
分类:
其他好文 时间:
2015-08-08 16:23:35
阅读次数:
106
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"].public cl...
分类:
其他好文 时间:
2015-08-08 16:14:37
阅读次数:
94
Implement a basic calculator to evaluate a simple expression string.The expression string contains onlynon-negativeintegers,+,-,*,/operators and empty...
分类:
其他好文 时间:
2015-08-08 16:13:23
阅读次数:
89
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()...
分类:
其他好文 时间:
2015-08-08 14:54:53
阅读次数:
98
Implement a basic calculator to evaluate a simple expression string.The expression string may contain open(and closing parentheses), the plus+or minus...
分类:
其他好文 时间:
2015-08-08 14:54:35
阅读次数:
114
Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1/** * Definition for a binary tree node...
分类:
其他好文 时间:
2015-08-08 14:51:13
阅读次数:
111
Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary tree every level, except...
分类:
其他好文 时间:
2015-08-07 23:53:56
阅读次数:
135
Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner as shown ...
分类:
其他好文 时间:
2015-08-07 23:53:55
阅读次数:
169
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matr...
分类:
其他好文 时间:
2015-08-07 21:54:10
阅读次数:
116
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr...
分类:
其他好文 时间:
2015-08-07 00:09:44
阅读次数:
174