Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def escapeGhosts(self, ghosts: List[List[int]], target: List[int]) -> bool:
- player_dist = abs(target[0]) + abs(target[1])
- for g in ghosts:
- if abs(target[0] - g[0]) + abs(target[1] - g[1]) <= player_dist:
- return False
- return True
Advertisement
Add Comment
Please, Sign In to add comment