You're navigating through an infinite 2D grid where you can move like a king in chess - in any of the 8 directions (horizontally, vertically, or diagonally) to adjacent cells.
Given your starting position (sx, sy) and target position (fx, fy), determine if you can reach the target in exactly t seconds.
Here's the catch: You must move every second - no standing still! However, you can revisit cells multiple times, allowing you to "waste" time by moving back and forth.
Goal: Return true if you can reach (fx, fy) after exactly t seconds, false otherwise.
Input & Output
Visualization
Time & Space Complexity
8 possible moves at each of t time steps creates exponential explosion
Recursion depth limited by time t, but exponential paths explored
Constraints
- 1 โค sx, sy, fx, fy โค 109
- 0 โค t โค 109
- Grid is infinite - no boundary constraints
- Must move every second - no staying in place