Practice Check if the Rectangle Corner Is Reachable
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Check if the Rectangle Corner Is Reachable
Problem Statement
You are given two positive integers xCorner and yCorner, and a 2D array circles, where circles[i] = [xi, yi, ri] denotes a circle with center at (xi, yi) and radius ri. There is a rectangle in the coordinate plane with its bottom left corner at the origin and top right corner at the coordinate (xCorner, yCorner). You need to check whether there is a path from the bottom left corner to the top right corner such that the entire path lies inside the rectangle, does not touch or lie inside any circle, and touches the rectangle only at the two corners. Return true if such a path exists, and false otherwise.
Source: Check if the Rectangle Corner Is Reachable on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
xCorner = 3, yCorner = 4, circles = [[2,1,1]]
true
# Example 2
xCorner = 3, yCorner = 3, circles = [[1,1,2]]
false
# Example 3
xCorner = 3, yCorner = 3, circles = [[2,1,1],[1,2,1]]
false
# Example 4
xCorner = 4, yCorner = 4, circles = [[5,5,1]]
true
Constraints
Related LeetCode Problems
Practice more problems similar to Check if the Rectangle Corner Is Reachable.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.