The answer is the number of subsets of all lengths from set arr [ 0. . n - 1 ] having XOR of elements as k
int ans = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { ans += dp [ n ] [ K ] [ i ] ; } return ans ; }