使用C++找出在第L个和第R个索引之间只有设置位的数字
在给定的问题中,我们需要找到一个数字的值,该数字在给定的范围L、R之间具有所有的设置位。例如 −
Input: L = 1, R = 5 Output: 62 Explanation: representation of given L and R in binary form is 0..0111110 Input: L = 1, R = 4 Output: 30 Explanation: representation of given L and R in binary form is 0..11110登录后复制