Company: AT&T_6march
Difficulty: medium
A coding competition organized to recruit software developers includes a problem involving the bitwise-OR operation. The score of a sequence is defined as the result of the bitwise-OR operation on its elements. Given an array arr of length n, identify all possible distinct scores that can be obtained by selecting any strictly increasing subsequence from the array. Return the results sorted in ascending order. Note: A subsequence is a sequence that can be derived from the given sequence by deleting zero or more elements without altering the order of the remaining elements. Example n = 4 arr = [4, 2, 4, 1] There are n = 4 elements in the array. The strictly increasing subsequences that can be chosen to have distinct score values are: Empty subsequence; score = 0 [1]; score = 1 [2]; score = 2 [4]; score = 4 [2, 4]; score = 6 There are no other strictly increasing subsequences that yield a different score value. So, the answer is [0, 1, 2, 4, 6], which is sorted in ascending order. Functio