1313. Decompress Run-Length Encoded List

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

Содержание

LeetCode problem 1313

class Solution:
    def decompressRLElist(self, nums: List[int]) -> List[int]:
        res = []
        for i in range(1, len(nums), 2):
            res.extend([nums[i]] * nums[i - 1])
        return res