Skip to content

Commit f3f7ab6

Browse files
authored
Merge pull request #113 from Mrtj2016/dev
add the solution 0789
2 parents 74f3a0a + 384b73b commit f3f7ab6

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.
Lines changed: 13 additions & 0 deletions
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)