摘要:
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space. 阅读全文
posted @ 2016-08-25 17:51
ArgenBarbie
阅读(367)
评论(0)
推荐(0)
摘要:
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are give 阅读全文
posted @ 2016-08-25 17:07
ArgenBarbie
阅读(143)
评论(0)
推荐(0)
摘要:
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. For example, given the following ma 阅读全文
posted @ 2016-08-25 15:51
ArgenBarbie
阅读(235)
评论(0)
推荐(0)
摘要:
题目: 输出有序数组的中两个元素差值为指定值diff的两个元素。 思路: 这与输出两个元素的和的值为一定值类似,需要两个指针,不同的是:指针不是一左一右,而是一前一后。 如果差值等于diff,则返回;如果差值大于diff,则左指针右移;如果差值小于diff,则右指针右移。 阅读全文
posted @ 2016-08-25 14:50
ArgenBarbie
阅读(529)
评论(0)
推荐(0)
摘要:
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes 阅读全文
posted @ 2016-08-25 10:30
ArgenBarbie
阅读(156)
评论(0)
推荐(0)
摘要:
79. Word Search Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent ce 阅读全文
posted @ 2016-08-25 09:48
ArgenBarbie
阅读(177)
评论(0)
推荐(0)
浙公网安备 33010602011771号