Max Increase to Keep City Skyline
A medium-tier problem at 86% community acceptance, tagged with Array, Greedy, Matrix. Reported in interviews at Rivian and 0 others.
Max Increase to Keep City Skyline is a medium-difficulty matrix problem that looks straightforward but trips up candidates who don't catch the greedy constraint. You're given a 2D grid representing building heights, and you can increase any cell's value, but only up to the minimum of its row max and column max. The puzzle: maximize the total increase without breaking the skyline. It's asked at Rivian and has a high acceptance rate of 86%, which means most people who attempt it pass, but that doesn't mean you'll see the pattern on first read. If this problem hits your live assessment and you blank on how to structure the greedy logic, StealthCoder runs invisibly and surfaces the solution in seconds.
Companies that ask "Max Increase to Keep City Skyline"
Max Increase to Keep City Skyline is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.
Get StealthCoderThe key insight is that each cell's increase is capped by min(row_max, column_max) minus its current value. This is a greedy problem, not dynamic programming. Many candidates try to optimize cell-by-cell or simulate changing values, which leads to overcomplicated code. The trick: pre-compute the maximum value in each row and column, then for every cell, the answer is simply min(max_row[i], max_col[j]) minus grid[i][j]. No need to actually modify the grid. The pitfall is overthinking it as a search or optimization problem when it's really just reading max bounds off two 1D arrays. If you freeze during the OA and the greedy reduction isn't clicking, StealthCoder delivers the algorithm and working code before you spiral.
Pattern tags
You know the problem.
Make sure you actually pass it.
Max Increase to Keep City Skyline recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Max Increase to Keep City Skyline interview FAQ
Why is this greedy and not dynamic programming?+
Each cell's max increase is independently determined by the min of its row and column max values. There's no dependency between cells that requires subproblems. Once you compute row and column maxima, the answer for each cell is deterministic. Greedy works because the constraint is local, not global.
What's the most common mistake on this problem?+
Trying to modify the grid in place and re-compute maxima after each change, or thinking you need to track state across cells. The problem is solved by reading the original row and column maxes once, then iterating. No updates needed.
Does Rivian ask this for backend or systems roles?+
The input doesn't specify role or stage. Treat it as a general coding screen problem. The 86% acceptance rate suggests most candidates who reach this problem have solid fundamentals, so it's likely used as a filter for clear thinking, not a hard blocker.
How does this relate to the other Array and Matrix topics?+
Array skills are needed to iterate and aggregate (summing increases). Matrix skills mean navigating rows and columns. Greedy is the algorithm pattern. Together they test your ability to break a 2D problem into 1D row and column scans, then apply a simple rule.
Is this problem still asked in 2024 OAs?+
It appears in reports from Rivian. The 86% acceptance rate and medium difficulty suggest it's used as a confidence builder or mid-tier filter, not a gating problem. Likely to stay in the pool, but not a top-frequency ask.
Want the actual problem statement? View "Max Increase to Keep City Skyline" on LeetCode →