Minimum Time Visiting All Points LeetCode solution in C++
1class Solution {2public:3int minTimeToVisitAllPoints(vector<vector<int>> &points) {4vector<int> sk;5int x, y, maxy = 0;6for (int i = 0; i < points.size() - 1; i++) {7for (int j = 0; j < points[i].size() - 1; j++) {8x = abs(points[i][j] - points[i + 1][j]);9y = abs(points[i][j + 1] - points[i + 1][j + 1]);10maxy += std::max(x, y);11}12}13return maxy;14}15};