def solve(self, cipher):
        tasks = cipher
        tasks.sort(key=lambda t: t[0])

        overshot = -1
        timer = 0
        for task in tasks:
            timer += task[1]
            overshot = max(overshot, timer - task[0])

        return overshot
Small test cases pass. Sort by deadline and complete them one by one
dataset/ETHPy150Open algorhythms/HackerRankAlgorithms/Task Scheduling.py/Solution.solve