leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
2849.cpp (241B)
0 class Solution { 1 public: 2 bool isReachableAtTime(int sx, int sy, int fx, int fy, int t) const { 3 const int x = abs(fx - sx), y = abs(fy - sy); 4 if (!x && !y && t == 1) return false; 5 return max(x, y) <= t; 6 } 7 };