we array arr nonnegative integersFor contiguous subarray sub arri arri 1 arrj j bitwise or element sub obtain result arri arri 1 arrjreturn number possible result result occur count final answer Example 1Input arr 0Output 1explanation there possible result 0example 2input arr 112output 3explanation the possible subarray 1 1 2 1 1 1 2 1 1 2these yield result 1 1 2 1 3 3there 3 unique value answer 3example 3Input arr 124output 6explanation the possible result 1 2 3 4 6 7 constraints1 numslength 5 1040 numsi 109