Construct Quad Tree at Uber

Medium78.1% acceptance

This problem has 87.5% frequency at Uber.

Problem Description

Given a `n * n` matrix `grid` of `0's` and `1's` only. We want to represent `grid` with a Quad-Tree. Return _the root of the Quad-Tree representing_`grid`. A Quad-Tree is a tree data structure in which each internal node has exactly four children. Besides, each node has two attributes: * `val`:...

Read full problem and hints

Topics

Also asked at 4 companies


More Uber Questions

View all Uber questions