1720. Decode XORed Array

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

Содержание

LeetCode problem 1720

class Solution:
    def decode(self, encoded: List[int], first: int) -> List[int]:
        res = [first]
        for e in encoded:
            res.append(res[-1] ^ e)
        return res