Bit Manipulation feature — Question:
Given an array containing distinct numbers taken from 0,1,2,…..,n, find the one that is missing form the array. Example:
[0,1,3,4] -> 2 You can use Bit Manipulation feature Example [0,1,3,4] -> 2 In this case, define A_List int array, int i =0, int result = 0
i -> gradually increase by 1 When i = 0 , A_List[0] = 0, result = 0
retult = retult^ i ^ AList[0] ; // result = 0