Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Misc
8.8K+ articles
Mathematical
7.8K+ articles
Competitive Programming
3.3K+ articles
Algorithms
2.0K+ articles
Bit Magic
1.2K+ articles
Bitwise-XOR
443+ articles
setBitCount
127+ articles
GFG-POTD-Solutions
43+ articles
Algorithms-Bit Algorithms
28 posts
Recent Articles
Popular Articles
Find a number containing N - 1 set bits at even positions from the right
Last Updated: 31 May 2022
Given a positive integer N, the task is to find a number which contains (N - 1) set bits in its binary form at every even index (1-based) from the right.Examples:Input: N ...
read more
Mathematical
Engineering Mathematics
C++
Mathematics
DSA
setBitCount
Algorithms-Bit Algorithms
number-theory
Bitwise Operations on Digits of a Number
Last Updated: 14 August 2021
Given a number N, the task is to perform the bitwise operations on digits of the given number N. The bitwise operations include:Finding the XOR of all digits of the given ...
read more
Algorithms
Mathematical
School Programming
Write From Home
DSA
Bitwise-XOR
Algorithms-Bit Algorithms
Bitwise-OR
Bitwise-AND
Convert given Binary string S to all 1s by changing all 0s to 1s in range [i+1, i+K] if S[i] is 1
Last Updated: 07 July 2021
Given a binary string S of size N and a number K, the task is to find if all the '0's can be changed into '1's in any number of operations. In one operation, if S[i] is in...
read more
Strings
Stack
Competitive Programming
Data Structures
DSA
Arrays
binary-string
Algorithms-Bit Algorithms
cpp-stack
Largest number less than equal to N having exactly K set bits
Last Updated: 15 October 2023
Given two positive integers N and K, we need to determine if there exists a positive integer X less than or equal to N such that the number of 1s in the binary representat...
read more
Bit Magic
DSA
setBitCount
Bitwise-XOR
Algorithms-Bit Algorithms
Bit Manipulation for Competitive Programming
Last Updated: 11 June 2024
Bit manipulation is a technique in competitive programming that involves the manipulation of individual bits in binary representations of numbers. It is a valuable techniq...
read more
Competitive Programming
DSA
Algorithms-Bit Algorithms
POTD Solutions | 29 Oct’ 23 | Check whether K-th bit is set or not
Last Updated: 28 April 2025
View all POTD SolutionsWelcome to the daily solutions of our PROBLEM OF THE DAY (POTD). We will discuss the entire problem step-by-step and work towards developing an opti...
read more
Competitive Programming
DSA
Algorithms-Bit Algorithms
GFG-POTD-Solutions
POTD Solutions | 28 Oct’ 23 | Bleak Numbers
Last Updated: 31 October 2023
Welcome to the daily solutions of ourPROBLEM OF THE DAY (POTD). We will discuss the entire problem step-by-step and work towards developing an optimized solution. This wil...
read more
Competitive Programming
DSA
Algorithms-Bit Algorithms
GFG-POTD-Solutions
POTD Solutions | 30 Oct’ 23 | Sum of XOR of all pairs
Last Updated: 22 November 2023
View all POTD SolutionsWelcome to the daily solutions of our PROBLEM OF THE DAY (POTD). We will discuss the entire problem step-by-step and work towards developing an opti...
read more
Competitive Programming
DSA
Bitwise-XOR
Algorithms-Bit Algorithms
GFG-POTD-Solutions
Solving Binary String Modulo Problem
Last Updated: 17 January 2024
Given a string "s" and an integer "m" your objective is to calculate the remainder "r" when the decimal value of binary string "s" is divided by "m".Examples: Input: s = "...
read more
Bit Magic
Geeks Premier League
DSA
Basic Coding Problems
math
Algorithms-Bit Algorithms
Geeks Premier League 2023
Find the value of X and Y such that X Bitwise XOR Y equals to (X+Y)/2
Last Updated: 16 January 2024
Given an integer N, representing X ⊕ Y where ⊕ represents Bitwise XOR, the task is to find the value of X and Y such that X ⊕ Y = (X+Y)/2. If no possible value of X and Y ...
read more
Bit Magic
Competitive Programming
DSA
Bitwise-XOR
Algorithms-Bit Algorithms
Maximizing Unset Bits in Integer with Constraints
Last Updated: 27 December 2023
Given a non-negative integer n. You are only allowed to make a set bit unset, the task is to find the maximum possible value of the query so that after performing the give...
read more
Bit Magic
Geeks Premier League
DSA
Algorithms-Bit Algorithms
Geeks Premier League 2023
XOR Graph Minimum Spanning Tree
Last Updated: 12 January 2024
Given a complete weighted graph where edges have weights determined by the bitwise-xor operation. The graph has N vertices numbered from 0 to N-1, and each undirected edge...
read more
Bit Magic
Competitive Programming
Picked
Geeks Premier League
DSA
Algorithms-Bit Algorithms
Bit Algorithms
Geeks Premier League 2023
Count the number of arrays formed by rearranging elements such that one adjacent element is multiple of other
Last Updated: 18 January 2024
Given array A[] of size N (1 = N = 15), count all possible arrays formed by rearranging elements of A[] such that at least one of the following conditions is true for adja...
read more
Geeks Premier League
DSA
Arrays
Algorithms-Dynamic Programming
Algorithms-Bit Algorithms
Geeks Premier League 2023
Find the number of ways to form a string of length N that can be rearranged to include S as a substring.
Last Updated: 29 January 2024
Given an integer N and string S of size M, the task is to find the number of ways of forming string of length N such that it is possible to rearrange the string to have S ...
read more
Strings
Dynamic Programming
Geeks Premier League
DSA
Algorithms-Bit Algorithms
Geeks Premier League 2023
Sort array by performing swapping under certain condition
Last Updated: 26 February 2024
Given an array of positive elements arr[] of size N. You can select any index i such that i + 1 N and swap arr[i], arr[i + 1] if they have the same number of set bits in ...
read more
Geeks Premier League
DSA
Arrays
Algorithms-Bit Algorithms
Geeks Premier League 2023
1
2
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !