Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- bool reachingPoints(int sx, int sy, int tx, int ty) {
- while (tx > 0 && ty > 0)
- {
- if (tx < sx || ty < sy)return false;
- if (tx == sx && ty == sy)return true;
- if (ty >= tx)ty -= tx;
- else if (tx > ty) tx -= ty;
- }
- return false;
- }
- };
Add Comment
Please, Sign In to add comment