
You are given a 2D integer array stockPrices where stockPrices[i] = [day _i , price _i ] indicates the price of the stock on day day _i is price _i . A line chart is created from the array by plotting the points on an XY plane with the X-axis representing the day and the Y-axis representing the price and connecting adjacent points. One such example is shown below:
Return the minimum number of lines needed to represent the line chart .
1 <= stockPrices.length <= 10 ^5stockPrices[i].length == 21 <= day _i , price _i <= 10 ^9All day _i are distinct .