You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are in an infinite 2D grid where you can move in any of the 8 directions
(x,y) to
(x-1, y-1),
(x-1, y) ,
(x-1, y+1),
(x , y-1),
(x , y+1),
(x+1, y-1),
(x+1, y) ,
(x+1, y+1)
You are given a sequence of points and the order in which you need to cover the points.. Give the minimum number of steps in which you can achieve it. You start from the first point.
solution:
int Solution::coverPoints(vector<int> &a, vector<int> &b) {