#include <iostream>
using namespace std;
int setIthBit(int num, int i) {
int bitMask = 1 << i;
return num | bitMask;
// if(num | 1 << i) -> mistake ?
}
int main()
{
cout<< setIthBit(6, 3);
return 0;
}
class Solution { public int [] countOppositeParity ( int [] nums ) { // approach 1 - checks every pair int n = n...
No comments:
Post a Comment