InterviewDB Question

Total Area Score: Compute Aggregate Score Over Rectangular Regions in a Grid

Question Details

Problem You are given an m x n grid of integers. For a list of queries, each query specifies a rectangle (r1, c1, r2, c2) (inclusive). Return the sum of all values in the rectangle for each query. Example: Approach Build a 2D prefix sum table in init…

Full Details

🔒

Unlock full leaked content

Full insider details, leaked discussions, and candidate experiences.

Get Premium →

Topics

Coding Onsite Phone