leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

1266.cpp (312B)


      1 class Solution {
      2   public:
      3     int minTimeToVisitAllPoints(const vector<vector<int>> &points) const {
      4         int res = 0;
      5         for (int i = 1; i < points.size(); i++) {
      6             res += max(abs(points[i][0] - points[i - 1][0]), abs(points[i][1] - points[i - 1][1]));
      7         }
      8         return res;
      9     }
     10 };