#3235

Check if the Rectangle Corner Is Reachable

international master · 2110 · lc hard +32 · 25.3% accepted · 121 likes · top 4%

Description

You are given positive integers xCorner and yCorner, and 2D array circles where circles[i] = [xi, yi, ri].

A rectangle occupies the plane with bottom-left at the origin and top-right at (xCorner, yCorner). Determine whether a path from (0, 0) to (xCorner, yCorner) exists that stays inside the rectangle, never enters any circle, and only touches the rectangle boundary at the two corners.

Return true if such a path exists.

Code

1
2
3