1
class Solution {
2
public boolean reachingPoints(int sx, int sy, int tx, int ty) {
3
if (sx == tx && sy == ty) {
4
return true;
5
}
6
if (tx < sx || ty < sy) {
7
return false;
8
}
9
return tx < ty
10
? reachingPoints(sx, sy, tx, Math.min(ty % tx + sy / tx * tx, ty - tx))
11
: reachingPoints(sx, sy, Math.min(tx % ty + sx / ty * ty, tx - ty), ty);
12
}
13
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0