Skip to content

Commit 384b73b

Browse files
committed
add the solution 0789
1 parent a2172e7 commit 384b73b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

solution/0789.Escape The Ghosts/README.md

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution:
2+
def escapeGhosts(self, ghosts, target):
3+
"""
4+
:type ghosts: List[List[int]]
5+
:type target: List[int]
6+
:rtype: bool
7+
"""
8+
flag=abs(target[0])+abs(target[1])
9+
for i in ghosts:
10+
if abs(i[0]-target[0])+abs(i[1]-target[1])<=flag:
11+
return False
12+
else:
13+
return True

0 commit comments

Comments
 (0)