We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fcb7e5 commit f6e2929Copy full SHA for f6e2929
Python/count-triplets-with-even-xor-set-bits-i.py
@@ -18,7 +18,7 @@ def count(a):
18
return [len(a)-odd, odd]
19
20
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))
+ 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))
22
23
24
# Time: O(nlogr), r = max(max(a), max(b), max(c))
0 commit comments