← All problemsSign in

2543. Check if Point Is Reachable

LeetCodeMathNumber TheoryOpen on judge ↗

There exists an infinitely large grid. You are currently at point (1, 1), and you need to reach the point (targetX, targetY) using a finite number of steps. In one step, you can move from point (x, y) to any one of the following points: - (x, y - x) - (x - y, y) - (2 * x, y) - (x, 2 * y) Given two integers targetX and targetY representing the X-coordinate and Y-coordinate of your final posit

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start