Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
- Maximum Number of Integers to Choose From a Range II
Coding
- Choose Numbers From Two Arrays in Range
Coding
- Maximum Number of Points From Grid Queries
Coding · Array · Breadth-First Search · Heap (Priority Queue)
- Number of Beautiful Integers in the Range
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2554. Maximum Number of Integers to Choose From a Range I
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source