Question : for an input number N, return the minimum number possible K such that there are N distinct integers less than or equal to K with total XOR as 0. Example : for N = 4, minimum number possible is 5 as 2^3^4^5 = 0. How should we solve this?
The first question , check if the ith bit is set or not, 0110 is six right , but given i=2, 1<<i will be 4 (0100) not 0010, hence return value should be return (n&(1<<(i-1)))>0, am I wrong?
sir at first you are taking one mask '010' which is comming from left shift of '001' and after that we are doing bitwise and.
1:28:36 8^7=15 8^5=13 8^3=11 ?
@shivamrastogi3154