EdocGram
Home
(current)
Topics
EdocAI
Code Editor
HTML
Javascript
PHP
Python
Python AI Code Editor
More
Contact
About
Privacy Policy
Terms and Conditions
Log In
Topic
View
More
Topic
Hashing
Linked List
Queue
Stack
Backtracking
Dynamic Programming
Graph Theory
Bit Manipulation
Mathematics
Sliding Window Technique
Divide And Conquer
Matrix Manipulation
Two Pointers
Tree
Topic: bit-manipulation-problem / Level: beginner
101. Check if a number has all its bits set.
102. Clear the lowest set bit in a binary number.
103. Implement a function to toggle bits from the k-th to the l-th positions.
104. Find the maximum bitwise AND of two numbers in a given range.
105. Check if a number has alternating 1s and 0s in its binary representation.
106. Set the most significant bit (MSB) in a binary number.
107. Write a function to rotate a number’s bits left by 2 positions.
108. Write a function to rotate a number’s bits right by 2 positions.
109. Implement a function that creates a mask where the middle k bits are set.
110. Create a function to convert a decimal number to its binary representation using bitwise operations.
111. Write a program to count how many numbers in an array have an even number of 1s in their binary representation.
112. Find the sum of the number of set bits in the binary representations of the elements of an array.
113. Check if a binary number has more 1s than 0s.
114. Create a function that toggles the last set bit of a binary number.
115. Check if a number’s binary representation has more trailing 0s than 1s.
116. Create a function that sets all bits in the left half of a binary number.
117. Write a function to calculate the number of leading 1s in a binary number.
118. Implement a function to create a mask with the least k bits cleared.
119. Check if the binary representation of a number is a palindrome.
120. Write a function to extract the last k bits of a number.
121. Create a function to toggle the k-th and l-th bits of a number.
122. Find the maximum XOR of two elements in an array.
123. Write a function that checks if the sum of two numbers results in a binary carry.
124. Implement a function to turn off all bits from the most significant bit to the ith bit.
125. Write a function to perform bitwise AND of two arrays.
126. Implement a function to flip all the bits of a binary number.
127. Write a program that sets the k-th bit of a number to 0.
128. Create a function to swap the first and last k bits of a number.
129. Implement a function to reverse the first k bits of a number.
130. Write a function that toggles all bits except for the kth bit.
131. Create a function that finds the most significant set bit in a number.
132. Implement a function that swaps two numbers without using an additional variable using bitwise operations.
133. Write a program to check if a number’s binary representation has an equal number of 1s and 0s.
134. Create a function that turns on all bits in the leftmost half of a binary number.
135. Write a program to set all bits except for the kth bit.
136. Implement a function that adds two numbers using only bitwise operators.
137. Write a function that toggles bits from position i to j.
138. Check if a number is a multiple of 64 using bitwise operators.
139. Create a function that returns true if a binary number has an even number of 0s.
140. Implement a function that checks if a binary number contains consecutive 0s.
141. Write a program that counts how many 0s are in the binary representation of a number.
142. Implement a function that checks if a binary number contains exactly one 1.
143. Write a function that extracts bits from position i to j in a binary number.
144. Create a function that shifts a binary number to the right by k positions.
145. Write a function to set all bits in the right half of a binary number.
146. Check if a binary number is all 0s except for one bit.
147. Write a function that swaps the first and last bits of a binary number.
148. Create a function that adds two binary numbers.
149. Write a program to reverse the last k bits of a binary number.
150. Implement a function that returns the number of 1 bits between two positions in a number.
Previous
2
3
4
...
20
Next
More Levels
Intermediate
Advanced
Aniket The Programmer
This website is managed by aniket the programmer :)
Website
Instagram