摘要:
题目:Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.代码:/** * Definition for a point. * struct Point { ... 阅读全文
摘要:
题目:Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) justified.You shoul... 阅读全文
摘要:
题目:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.代码:class Solution {public: int div... 阅读全文
摘要:
题目:The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font... 阅读全文
摘要:
题目:Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following ma... 阅读全文
摘要:
题目:Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3... 阅读全文