Maximum Number of Groups Entering a Competition
You're given a positive integer array, grades, representing the grades of students in a university. Your goal is to enter all these students into a competition in ordered non-empty groups, ensuring that the ordering meets the following conditions:
- The sum of the grades of students in the ith group is less than the sum of the grades of students in the (i + 1)th group, for all groups (except the last).
- The total number of students in the ith group is less than the total number of students in the (i + 1)th group, for all groups (except the last).
Your task is to determine and print the maximum number of groups that can be formed.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)