In this solution i tried to make both current number and previous number as bit arrays and tried to find the bits where if in 1st array , the bit is 1 and in the 2nd the bit is also one , there are 2 ways of selecting(0&1) and if bit in 1st array is 1 and in second array is 0 , then ans must be 0. Please find the error.
i had several WA attempts then figured we need to handle the case of improper input. The problem statement didn’t provide what should be given as output in the case of improper input so I assumed it to be zero. Interesting part is … I corrected the code and checked the condition where arr[i]<arr[i-1] and got an AC.
but for the input say
i got output as 16 but the output should be 0 as it is not a valid sequence but my code passed and got an AC during contest XD
the input case test file during the contest didn’t cover this case I guess ?