C++ {Speed,Mem} = {O(m+n), O(1)}
\nclass Solution {\npublic:\n    bool escapeGhosts(vector<vector<int>>& ghosts, vector<int>& target) {\n        \n        // escape condition: you have to be cl
```\nclass Solution {\npublic:\n    bool escapeGhosts(vector<vector<int>>& ghosts, vector<int>& target) {\n        \n        // escape condition: you have to be closer to target than ghost\n        int dist = INT_MAX;\n        \n        for(int i=0; i < ghosts.size(); i++)\n            dist = min(dist, abs(target[0]-ghosts[i][0])+abs(target[1]-ghosts[i][1]));\n        \n        //cout << "dist=" << dist << endl;\n        if(abs(target[0])+abs(target[1]) >= dist)\n            return false;\n        \n        return true;\n        \n    }\n};\n```
['C', 'C++']