values. Count the ordered triples of indices (i, j, k) such that values[i] & values[j] & values[k] == 0, where & is bitwise AND.
Indices may repeat, and triples that differ only in the order of their indices count separately.values=[1, 6] → 6
1 & 6 = 0, so any triple that uses both indices works: of the 8 triples only (0, 0, 0) and (1, 1, 1) fail, so the answer is 6.
values=[7, 7] → 0
Every triple gives 7 & 7 & 7 = 7.
values=[0] → 1
The only triple, (0, 0, 0), gives 0.
values=[1, 6]
6
Run checks the first 3 tests in your browser. Submit checks all 91 tests on the server, hidden ones included.