serega1112

789

Jan 15th, 2021
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. class Solution:
  2.     def escapeGhosts(self, ghosts: List[List[int]], target: List[int]) -> bool:
  3.        
  4.         player_dist = abs(target[0]) + abs(target[1])
  5.        
  6.         for g in ghosts:
  7.             if abs(target[0] - g[0]) + abs(target[1] - g[1]) <= player_dist:
  8.                 return False
  9.            
  10.         return True
Advertisement
Add Comment
Please, Sign In to add comment