You are given an integer array nums representing a class of students.
A group of students needs to be selected. A student at index i is happy if and only if one of the following conditions is satisfied:
The student is selected and the total number of selected students is strictly greater than nums[i].
The student is not selected and the total number of selected students is strictly less than nums[i].
Return the total number of ways to choose a group of students such that every student in the class is happy.
Constraints:
nums.length
nums[i] nums.length
You are given an integer array nums representing a class of students.
A group of students needs to be selected. A student at index i is happy if and only if one of the following conditions is satisfied:
The student is selected and the total number of selected students is strictly greater than nums[i].
The student is not selected and the total number of selected students is strictly less than nums[i].
Return the total number of ways to choose a group of students such that every student in the class is happy.
Constraints:
nums.length
nums[i] nums.length