Maximum beads placed in two containers under constraints
Filed under Salesforce
The question
Given an array of sizes (S, M, L, XL), find the maximum number of beads that can be placed in 2 containers such that each container can have multiple beads of the same size, starting with any size without skipping, and stopping when a bead of the third size must be picked.
No write-up yet. Related questions below have one.
Related Salesforce questions
Collected from public candidate posts and coding forums. Updated Nov 2026.