1720. Decode XORed Array

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

On This Page

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