Search
⌘K

Leetcode 2172. Maximum AND Sum of Array

Place each number into one of numSlots (each slot holds at most two numbers) to maximize the sum of (number AND slotIndex). With numSlots ≤ 9 and n ≤ 2*numSlots, the core challenge is a combinatorial assignment optimized via bitmask/DP (or base-3 slot-occupancy DP).


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.