Minimum Lines to Represent a Line Chart

You are given a 2D integer array stockPrices where stockPrices[i] = [dayi, pricei] indicates the price of the stock on day dayi. All dayi are distinct.

Return the minimum number of lines needed to represent the line chart.

A line chart is a representation where each point is connected to the next point by a straight line. Consecutive points that lie on the same straight line can be represented by a single line segment in that direction.

Examples
Input: [5]
Output: 0
Hints

Minimum Lines to Represent a Line Chart

You are given a 2D integer array `stockPrices` where `stockPrices[i] = [dayi, pricei]` indicates the price of the stock on day `dayi`. All `dayi` are distinct.