track all possible combinations of open slots | python3
Approach\n Keep track of all possible options which will contain slots of time to fit in a given task\n Start with one option of one slot of sessionTime \n For 
### Approach\n* Keep track of all possible options which will contain slots of time to fit in a given `task`\n* Start with one option of one slot of `sessionTime` \n* For each new `task`, we have two choices:\n\t* Fit the `task` in one of the open slots in one of the available options, creating more opitons of slots\n\t* Allot an entirely new slot of `sessionTime`\n* Using tuples and sorting slot options by slot size allows us to avoid duplicate slot options and also break out of the inner loop sooner\n* At the end, the option with the least number of slots is the one that utilized all the slot in the most optimum way. So smallest length is the answer. \n* This approach essentially explores all possible ways to schedule the tasks, so it\'s an exhaustive search, similar to a DFS/BFS solution. \n\n\n```\ndef minSessions(self, tasks: List[int], sessionTime: int) -> int:\n        tasks.sort(reverse=True)\n        options = set([(sessionTime,)])\n        for time in tasks:\n            new_options = set()\n            for slots in options:\n                for i, slot in enumerate(slots):\n                    if slot >= time:\n                        new_option = list(slots)\n                        new_option[i] = slot-time\n                        new_options.add(tuple(sorted(new_option, reverse=True)))\n                    else:\n                        break\n                new_options.add(tuple(sorted(slots + (sessionTime-time,), reverse=True)))\n            options = new_options\n        \n        return min(map(len, options))\n```\n\n*This consistently runs faster than all Python3 solutions at the time of posting this.*
[]