Skip to content

Commit

Permalink
fix import statement
Browse files Browse the repository at this point in the history
  • Loading branch information
ehdgua01 committed Nov 5, 2024
1 parent 021dad5 commit f4d32b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions coding_test/leetcode/sum_of_all_subset_xor_totals/test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import functools
import operator
from functools import reduce
from itertools import combinations
from operator import xor
from typing import List


class Solution:
def subsetXORSum(self, nums: List[int]) -> int:
return sum(functools.reduce(operator.xor, c) for i in range(1, len(nums) + 1) for c in combinations(nums, i))
return sum(reduce(xor, c) for i in range(1, len(nums) + 1) for c in combinations(nums, i))


def test_subsetXORSum():
Expand Down

0 comments on commit f4d32b8

Please sign in to comment.