[Python3] brainteaser
Algo\nThis problem is really a brainteaser. The condition to escape the ghost is simply that the player is closer to the target than any of the ghosts. Here, di
Algo\nThis problem is really a brainteaser. The condition to escape the ghost is simply that the player is closer to the target than any of the ghosts. Here, distance is measured via Manhattan distance.  \n\nImplementation \n```\nclass Solution:\n    def escapeGhosts(self, ghosts: List[List[int]], target: List[int]) -> bool:\n        xx, yy = target \n        return all(abs(x-xx) + abs(y-yy) > abs(xx) + abs(yy) for x, y in ghosts)\n```\n\nAnalysis\nTime complexity `O(N)`\nSpace complexity `O(1)`
['Python3']