If the last bit is ON
if ( ( mask & 1 ) != 0 ) { if ( hash . ContainsKey ( mask ) ) { dp [ mask , 0 ] = hash [ mask ] ; } if ( hash . ContainsKey ( mask ^ 1 ) ) { dp [ mask , 0 ] += hash [ mask ^ 1 ] ; } } else {