Leetcode 805 Solution
This article provides solution to leetcode question 805 (escape-the-ghosts)
Access this page by simply typing in "lcs 805" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/escape-the-ghosts
Solution
class Solution:
def escapeGhosts(self, ghosts: List[List[int]], target: List[int]) -> bool:
limit = int(abs(target[0])) + int(abs(target[1]))
for ghost in ghosts:
if int(abs(ghost[0] - target[0])) + int(abs(ghost[1] - target[1])) < limit:
return False
return True