#include <leetcode.h>
|
static int | maxPoints (vector< vector< int > > &points) |
|
◆ maxPoints()
int leetcode::max_points_on_a_line::Solution::maxPoints |
( |
vector< vector< int > > & |
points | ) |
|
|
static |
在文件 leetcode.cpp 第 6850 行定义.
6852 for(
auto &p1: points) {
6853 unordered_map<long double, int> us;
6855 for(
auto &p2: points) {
6856 if(p2[0] != p1[0]) {
6857 us[
static_cast<long double>(p2[1] - p1[1]) /
static_cast<long double>(p2[0] - p1[0])]++;
6862 for(
auto &[k, v]: us) {
6863 cnt = max(cnt, v + 1);
6865 ans = max(ans, cnt);
被这些函数引用 leetcode::max_points_on_a_line::TEST().
该类的文档由以下文件生成: