There is a line chart plotted on a y of length n. The chart consists of
A horizontal line intersects a line segment if they share at least one common point.
Return the maximum number of intersections that a horizontal line can have with the chart.
Constraints:
y.length
y[i]
y[i] != y[i + 1] for i in range
There is a line chart plotted on a y of length n. The chart consists of
A horizontal line intersects a line segment if they share at least one common point.
Return the maximum number of intersections that a horizontal line can have with the chart.
Constraints:
y.length
y[i]
y[i] != y[i + 1] for i in range