NeetCode #843LC-3394MediumIntervals
← Back to All Problems

#843 · #3394 · Check if Grid can be Cut into Sections(判断网格图能否被切割成块)

📌 Problem Statement & Constraints

You are given an integer n and a 2D array rectangles where rectangles[i] = [x1, y1, x2, y2] is an axis-aligned rectangle inside an n x n grid. Return true if you can make either two horizontal cuts or two vertical cuts that split the grid into three sections, each containing at least one rectangle, without cutting through any rectangle. Constraints: 3 <= n <= 10^9, 3 <= rectangles.length <= 10^5, 0 <= x1 < x2 <= n, 0 <= y1 < y2 <= n.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!