Search
⌘K

Leetcode 2543. Check if Point Is Reachable

Given an infinite integer grid and allowed moves that either double one coordinate or replace a coordinate by its difference with the other ((x,y) -> (2x,y), (x,2y), (x,y-x), (x-y,y)), determine whether (targetX,targetY) can be reached from (1,1). Targets up to 1e9 force a mathematical/reverse-reduction approach rather than brute-force search.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.