Simple C++ code, have a look


#1

int Solution::coverPoints(vector &A, vector &B) {
int steps=0;
int ans;
for(int i=0;i<A.size()-1;i++)
{
ans=max(abs(A[i+1]-A[i]),abs(B[i+1]-B[i]));
steps=steps+(ans);
}
return steps;
}