AC by lucky
As the task length is pretty small, if we random shuffle a large number of times, we will have a high possibility to find the optimal result. The solution is si
As the task length is pretty small, if we random shuffle a large number of times, we will have a high possibility to find the optimal result. The solution is simple:\nRandom shuffle N times and find the minimum result.\n\nI guess the test cases are not that strong, so I can get the code AC by lucky.\n\n```python\nclass Solution:\n    def minSessions(self, tasks: List[int], sessionTime: int) -> int:\n        ret = float("inf")\n        for i in range(10000):\n            random.shuffle(tasks)\n            thisret = 0\n            j, curr = 0, 0\n            while j < len(tasks):\n                if curr + tasks[j] <= sessionTime:\n                    curr += tasks[j]\n                else:\n                    thisret += 1\n                    curr = tasks[j]\n                j += 1\n            if curr > 0:thisret += 1\n            ret = min(ret, thisret)\n        return ret\n```
[]