Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 给一个点集,判断在一条直线上的点最多有多少个。枚举每一个点,算其他点和它的斜率,然后用一个unordered_m.....
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify ...
Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrences of a...
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands ...
题目:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two number...
题目:Max Points on a lineGiven n points on a 2D plane, find the maximum number of points that lie on the same straight line.这道题需要稍微转变一下思路,用斜率来实现,试想找在同一条直线上的点,怎么......