1313. Decompress Run-Length Encoded List

Updated: 2024-03-12
1 min read
[]

On This Page

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