Escape The Ghosts LeetCode solution in Python

1
class Solution:
2
def escapeGhosts(self, ghosts: List[List[int]], target: List[int]) -> bool:
3

4
dist = lambda x: abs(x[0] - target[0]) + abs(x[1] - target[1])
5

6
return dist((0, 0)) < min(dist(g) for g in ghosts)

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0