Python Code || Easy || Manhattan Distance
\n\n# Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \n
\n\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def escapeGhosts(self, ghosts: List[List[int]], target: List[int]) -> bool:\n        d_ghost_to_target=[] \n        #Manhattan Distance works coz at any point if you are closer to the target, you can reach the target before the ghost does.\n\n        for x,y in ghosts:\n            d_ghost_to_target.append(abs(x-target[0])+abs(target[1]-y))\n        \n        me_to_target=abs(target[0])+abs(target[1])\n        for dis in d_ghost_to_target:\n            if dis<=me_to_target:\n                return False\n        return True\n\n```
['Math', 'Python3']