values of non-negative integers. For every non-empty window of consecutive elements, take the bitwise OR (|) of all its elements. The OR of a one-element window is that element itself.
How many distinct values come out? Return their count.values=[4, 1, 4] → 3
The windows give 4, 1, 4, 4 | 1 = 5, 1 | 4 = 5 and 4 | 1 | 4 = 5. There are three distinct values: 1, 4, 5.
values=[3, 3, 3] → 1
Every window gives 3.
values=[1, 2, 4, 8] → 10
All 10 windows give different values: 1, 2, 4, 8, 3, 6, 12, 7, 14, 15.
values=[4, 1, 4]
3
Run checks the first 3 tests in your browser. Submit checks all 94 tests on the server, hidden ones included.