摘要:
Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].这里主要注意的是STL的... 阅读全文
摘要:
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.Method I解决思路和求最短不减子序列类似:开一个数组lines,第k个位置存放的是有k个点的直线,由... 阅读全文
摘要:
The algorithm for evaluating any postfix expression is fairly straightforward:While there are input tokens leftRead the next token from input.If the t... 阅读全文
摘要:
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one letter can be ch... 阅读全文
摘要:
Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the p... 阅读全文
摘要:
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Did you use extra space?A straight forward solution using... 阅读全文
摘要:
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted fr... 阅读全文
摘要:
A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any p... 阅读全文