Search
⌘K

Leetcode 2554. Maximum Number of Integers to Choose From a Range I

Given a banned set, n, and maxSum, pick the maximum number of distinct integers from 1..n (excluding banned values) whose total sum does not exceed maxSum. The core challenge is maximizing count under a sum budget — typically solved by greedily taking the smallest allowed numbers.


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.