C++ code with simple explanation
Intuition\nFirst thought was that I had to check if I can reach any position starting from (0, 0). Then it struck my mind that it doesn\'t matter if I reach eve
# Intuition\nFirst thought was that I had to check if I can reach any position starting from (0, 0). Then it struck my mind that it doesn\'t matter if I reach every position. If I cannot reach target, I cannot win in any way.\n\n# Approach\nExplained in comments\n\n# Complexity\n- Time complexity: O(N)\n\n- Space complexity: O(1)\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    bool escapeGhosts(vector<vector<int>>& ghosts, vector<int>& target) \n    {\n        // observation: it doesn\'t matter if I can reach every position\n        // If I cannot reach target, then I cannot win\n        // Mathematically put, if any ghost\'s manhattan distance is less than or equal to mine,\n        // then I cannot win.\n        // My manhattan distance needs to be lesser than all other\'s distances\n\n        int myDist = abs(target[0]) + abs(target[1]);\n\n        for(auto &vec: ghosts)    \n        {\n            int ghostDist = abs(target[0] - vec[0]) + abs(target[1] - vec[1]);\n            if(ghostDist <= myDist)\n            return false; \n        }\n\n        return true;\n    }\n};\n```
['Array', 'Math', 'Geometry', 'C++']