描述 Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 分析暴力搜索的话时间O(n^3),会超时。可以考虑用缓存来加速,比如对和某两点(p1, p2 ...
阅读全文 »

描述 Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 分析不用乘法、除法、取模运算来实现除法。可以只用加减法来实现,但是太 ...
阅读全文 »