preparing a number ' num ' and ' left _ shift ' which can be further used for the check of alternate pattern in the given range
if ( isKthBitSet ( n , r ) ) { num = n ; left_shift = r ; } else { num = setKthBit ( n , ( r + 1 ) ) ; left_shift = r + 1 ; }