You are viewing a single comment's thread. Return to all comments →
C++
int bitwiseAnd(int N, int K) { int max = 0; int themacneeded; list<int> myList; if ( K == 1) { return themaxneeded = 0; } else{ for (int i= 2; i < N ; i++){ for ( int j = i +1 ; j <= N ; j++){ max= i & j; if ( max < K && max >= themaxneeded){ themaxneeded = max ; } } } return themaxneeded; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 29: Bitwise AND
You are viewing a single comment's thread. Return to all comments →
C++