Skip to content
LC-2317 Medium LeetCode

2317. Maximum XOR After Operations

Read the full problem statement on LeetCode.
Difficulty: medium Acceptance: 79% Topics: Array, Math, Bit Manipulation
View full problem on LeetCode
Reference solution (spoiler · python)
# Time:  O(n)
# Space: O(1)

# bit manipulation
class Solution(object):
    def maximumXOR(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        return reduce(lambda x, y: x|y, nums)

Solution from kamyu104/LeetCode-Solutions · MIT