PROBLEM DESCRIPTION
Given a number N and a value K. From the right, set the Kth bit in the binary representation of N. The position of Least Significant Bit(or last bit) is 0, the second last bit is 1 and so on.
SOLUTION
1
2
3
4
5
6
class Solution{
static int setKthBit(int N,int K){
// code here
return (N | (1 << K));
}
}