Plan Ordered Study Sessions

Build study sessions from ordered {name, minutes} tasks and a positive integer session budget. Fill each session before starting the next; split long tasks across sessions while preserving task order and names. Return a list of sessions, each a list of {name, minutes} portions. Ignore zero/negative task durations. Empty tasks returns []; non-positive budget returns None.

Difficulty: advanced

Examples

  • [[{"name":"Python","minutes":20},{"name":"SQL","minutes":25}],30][[{"name":"Python","minutes":20},{"name":"SQL","minutes":10}],[{"name":"SQL","minutes":15}]]

Your solution

Python

Results

Python starts when you run or submit this challenge.

Back to Lesson