摘要:
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the minimum element. 阅读全文
摘要:
Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t 阅读全文
摘要:
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 pr 阅读全文
摘要:
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
摘要:
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 求二维平面上n个点中,最多共线的点数。 1、比较直观的方法是,三层循环,以任意两点划线,判断第三个点 阅读全文