Construct Quad Tree
CodingPhone, OnsiteSoftware EngineerReported Dec, 2026Medium Frequency
Company question banks are included with the Insider plan.
You are given an n x n binary matrix grid, where n is a power of 2. Build and return the root of a quad tree that represents the matrix.
Each node represents a square region: