bit manipulation1 Leetcode 1720. Decode XORed Array 1 2 3 4 5 6 class Solution: def decode(self, encoded: List[int], first: int) -> List[int]: ans=[first] for i in encoded: ans.append(i^ans[-1]) return ans Colored by Color Scripter cs XOR -> Exclusive OR 문제구요 학부때 배웠던 Logical circuit 생각해보시면 쉽게 풀수있는데 파이썬에서는 " ^ " operator가 XOR 입니다. 아마 다른언어에서는 power의 개념으로 쓰이는 operator죠 2021. 8. 31. 이전 1 다음