SImple Python3 Solution || beats 98% of Users || ✅
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nWe are given with a lis
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nWe are given with a list of lists namely,ghosts and a list namely,target,\nSo initally we calculate the distance between origin and the Target.\nThen we just do the same with each and every ghost location(co-ordinates),\nandif the the ghost distance is less than or equal to distance from origin to target, the pac-man dies(False) else he wins(True).\nHere\'s a SIMPLE PYTHON3 Implementation of the above approach:\nP.S.> This approach beats around 98% of the users in run time.\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def escapeGhosts(self, ghosts: List[List[int]], target: List[int]) -> bool:\n        targ_dist=abs(target[0])+abs(target[1])\n        for i in ghosts:\n            targ_dist1=abs(i[0]-target[0])+abs(i[1]-target[1])\n            if(targ_dist1<=targ_dist):\n                return False\n        return True\n```
['Math', 'Iterator', 'Python3']