leetcode_rust/max_points_on_a_line.rs
1//#![allow(dead_code)]
2//
3//#[derive(Debug, PartialEq, Eq)]
4//pub struct Point {
5// pub x: i32,
6// pub y: i32,
7//}
8//
9//impl Point {
10// #[inline]
11// pub fn new(x: i32, y: i32) -> Self {
12// Point { x, y }
13// }
14//}
15//
16//// todo
17//pub fn max_points(points: Vec<Point>) -> i32 {
18// use std::collections::HashMap;
19// use std::f64;
20// if points.len() < 3 {
21// return points.len() as i32;
22// }
23// let mut map = HashMap::new();
24// for p in points {
25// map.get_mut(&p)
26// }
27//
28// unimplemented!()
29//}
30//
31//#[cfg(test)]
32//mod tests {
33// use super::*;
34//
35// #[test]
36// fn test1() {
37// let points = vec![
38// Point::new(1, 1),
39// Point::new(3, 2),
40// Point::new(4, 1),
41// Point::new(2, 3),
42// Point::new(1, 4),
43// ];
44// assert_eq!(max_points(points), 4);
45// }
46//}