Problem: Robot Navigation with Circular Sensor Traps
You are given a 2D rectangular room of dimensions w × h (width × height). Inside the room are n security sensors, each located at a specific (x, y) coordinate and having a circular detection radius r.
The robot starts at the bottom-left corner (0, 0) and needs to reach the top-right corner (w, h). The robot can move in any direction, including diagonally or along a curved path, as long as it does not enter the detection zone (i.e., the circular area) of any sensor.
If the robot’s path touches or enters even one sensor’s detection zone, the alarm is triggered and the path is invalid.
Task
Implement a function:
def pathExists(positions: List[List[int]], w: int, h: int) -> bool:Return:

Solution:
Verdict: Selected for on-site rounds.