Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 459 Bytes

789.md

File metadata and controls

27 lines (18 loc) · 459 Bytes

Escape The Ghosts

Description

link


Solution

  • See Code

Code

class Solution:
    def escapeGhosts(self, ghosts: List[List[int]], target: List[int]) -> bool:
        dist = abs(target[0]) + abs(target[1])
        for x, y in ghosts:
            if abs(target[0] - x) + abs(target[1] - y) <= dist:
                return False
        return True