All Posts
Leetcode 2358: Maximum Number of Groups Entering a Competition
You are given a positive integer array grades which represents the grades of students. Your goal is to group these students into ordered non-empty groups where:
- The sum of the grades in the i-th group is less than the sum of the grades in the (i + 1)-th group.
- The number of students in the i-th group is less than the number of students in the (i + 1)-th group. Return the maximum number of groups that can be formed.