Skip to content

Commit c8002e5

Browse files
committedSep 17, 2019
2019-09-16
1 parent 6f2e5a9 commit c8002e5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution(object):
2+
def reachingPoints(self, sx, sy, tx, ty):
3+
"""
4+
:type sx: int
5+
:type sy: int
6+
:type tx: int
7+
:type ty: int
8+
:rtype: bool
9+
"""
10+
if tx < sx or ty < sy:
11+
return False
12+
if tx == sx and (ty - sy) % sx == 0:
13+
return True
14+
if ty == sy and (tx - sx) % sy == 0:
15+
return True
16+
return self.reachingPoints(sx, sy, tx % ty, ty % tx)

0 commit comments

Comments
 (0)