The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total Hamming distance between …
Given two integers L and R, find the count of numbers in the range (inclusive) having a prime number of set bits in their binary representation. (Recall that the …
A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents a …
A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules: For 1-byte character, the first bit is a 0, followed by its …
Given an integer, check if its binary representation are containing the alternating bits. For example, 101, 10101, 1010 are binary numbers with alternative bits. But 1011, 1110 are not. …