https://leetcode.com/problems/minimum-number-of-work-sessions-to-finish-the-tasks/discuss/1431836/C%2B%2B-Solution-or-Recursion-%2B-Memoization
Input Format
Check the link
Output Format
Check the link
Constraints
Check the link
Example
Input
Output