2527. Find Xor-Beauty of Array ¶ Time: $O(n)$ Space: $O(1)$ C++JavaPython 1 2 3 4 5 6class Solution { public: int xorBeauty(vector<int>& nums) { return accumulate(nums.begin(), nums.end(), 0, bit_xor<>()); } }; 1 2 3 4 5class Solution { public int xorBeauty(int[] nums) { return Arrays.stream(nums).reduce((a, b) -> a ^ b).getAsInt(); } } 1 2 3class Solution: def xorBeauty(self, nums: list[int]) -> int: return functools.reduce(operator.xor, nums)