[Python3] bit-mask dp
Please see this commit for solutions of weekly 256.\n\n\nclass Solution:\n    def minSessions(self, tasks: List[int], sessionTime: int) -> int:\n        \n     
Please see this [commit](https://github.com/gaosanyong/leetcode/commit/7abfd85d1a68e375fcc0be60558909fd98b270f3) for solutions of weekly 256.\n\n```\nclass Solution:\n    def minSessions(self, tasks: List[int], sessionTime: int) -> int:\n        \n        @cache\n        def fn(mask, rem):\n            """Return minimum work sessions to finish tasks indicated by set bits in mask."""\n            if not mask: return 0 # done \n            ans = inf \n            for i, x in enumerate(tasks): \n                if mask & (1<<i): \n                    if x <= rem: ans = min(ans, fn(mask ^ (1<<i), rem - x))\n                    else: ans = min(ans, 1 + fn(mask ^ (1<<i), sessionTime - x))\n            return ans\n        \n        return fn((1<<len(tasks))-1, 0)\n```
['Python3']