Skip to content

Commit f6e2929

Browse files
authored
Update count-triplets-with-even-xor-set-bits-i.py
1 parent 1fcb7e5 commit f6e2929

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/count-triplets-with-even-xor-set-bits-i.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def count(a):
1818
return [len(a)-odd, odd]
1919

2020
cnt = map(count, (a, b, c))
21-
return sum(cnt[0][1^int(i == 0 or i == 1)]*cnt[1][1^int(i == 0 or i == 2)]*cnt[2][1^int(i == 0 or i == 3)] for i in xrange(4))
21+
return sum(cnt[0][0 if i == 0 or i == 1 else 1]*cnt[1][0 if i == 0 or i == 2 else 1]*cnt[2][0 if i == 0 or i == 3 else 1] for i in xrange(4))
2222

2323

2424
# Time: O(nlogr), r = max(max(a), max(b), max(c))

0 commit comments

Comments
 (0)