โ† Uber questions

Maximum array sum after removing elements and groups

Filed under Uber

The question

Given an array of N elements, you can remove p single elements, q consecutive groups of size 2, and r consecutive groups of size 3. After removals, the remaining left and right arrays are merged. Output the maximum possible sum.

No write-up yet. Related questions below have one.

Related Uber questions

Collected from public candidate posts and coding forums. Updated Nov 2026.