A critical point in a linked list is defined as either a local maxima or a local minima.A node is a local maxima if the current node has a value strictly greater than the previous node and the next node.A node is a local minima if the current node has a value strictly smaller than the previous node and the next node.Note that a node can only be a local maxima/minima if there exists both a previous node and a next node.Given a linked list head, return an array of length 2 containing[minDistance, maxDistance]whereminDistanceis theminimum distancebetweenany two distinctcritical points andmaxDistanceis themaximum distancebetweenany two distinctcritical points. If there arefewerthan two critical points, return[-1, -1].