1860. Incremental Memory Leak

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1860

class Solution:
    def memLeak(self, memory1: int, memory2: int) -> List[int]:
        i = 1
        while i <= max(memory1, memory2):
            if memory1 >= memory2:
                memory1 -= i
            else:
                memory2 -= i
            i += 1
        return [i, memory1, memory2]