leetcode

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

2849.cpp (241B)


1 class Solution { 2 public: 3 bool isReachableAtTime(int sx, int sy, int fx, int fy, int t) const { 4 const int x = abs(fx - sx), y = abs(fy - sy); 5 if (!x && !y && t == 1) return false; 6 return max(x, y) <= t; 7 } 8 };