Practice Maximum Number of Groups Entering a Competition
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Medium#2358
LeetCode ProblemMaximum Number of Groups Entering a Competition
Problem Statement
Partition all students, with grades given by grades, into ordered nonempty groups. Both the group size and sum of grades must strictly increase from each group to the next. Return the greatest possible number of groups; students may be assigned freely.
Source: Maximum Number of Groups Entering a Competition on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
grades = [10,6,12,7,3,5]
Output
3
# Example 2
Input
grades = [8,8]
Output
1
Constraints
1 <= grades.length <= 10^5
1 <= grades[i] <= 10^5
Related LeetCode Problems
Practice more problems similar to Maximum Number of Groups Entering a Competition.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.