[LeetCode] Maximum Number of Intersections on the Chart

1 · · Jan. 27, 2024, 3:07 a.m.
Summary
3009. Maximum Number of Intersections on the Chart There is a line chart consisting of n``y. The kth point has coordinates (k, y[k]). There are no horizontal lines; that is, no two consecutive points have the same y-coordinate. We can draw an infinitely long horizontal line. Return the maximum number of points of intersection of the line with the chart. ...