Search
⌘K

Leetcode 1659. Maximize Grid Happiness

Place up to given numbers of introverts and extroverts on an m×n grid (neighbors are 4-directional) where each type has different base happiness and per-neighbor gain/loss, and maximize total grid happiness. This requires state-compressed dynamic programming (row-wise/backtracking with encoded neighbor states and remaining counts) to handle local interactions and limited supplies.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.