Courses
Tutorials
Practice
Sign In
Switch to Dark Mode
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
Misc
8.8K+ articles
Mathematical
7.8K+ articles
Arrays
6.5K+ articles
Competitive Programming
3.3K+ articles
Strings
3.3K+ articles
Greedy
2.1K+ articles
Algorithms
2.0K+ articles
Sorting
1.8K+ articles
Searching
1.7K+ articles
DSA
/
Algorithms
/
Bit Magic
Bit Magic
1.2K+ posts
Recent Articles
Popular Articles
Minimum Bitwise AND operations to make two numbers equal
Last Updated: 31 July 2023
Given two numbers a and b, the task is to find the minimum number of operations required to make a and b equal. In each operation, we can pick a non-negative integer x and...
read more
Bit Magic
DSA
Data Structures
Bitwise-AND
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
Maximize score of Binary Matrix by Flipping a row or column each time
Last Updated: 19 September 2023
Given a Binary matrix of size MxN, the task is to maximize the score of Matrix by making any number ofmoves (including zero moves), such that, every row is interpreted as ...
read more
Bit Magic
Matrix
Picked
DSA
Goldman Sachs
Greedy Algorithms
Maximum XOR of Two Binary Numbers after shuffling their bits.
Last Updated: 27 March 2024
Given two n-bit integers a and b, find the maximum possible value of (a' xor b') where a' is a shuffle-a, b' is a shuffle-b and xor is the bitwise xor operator.Note: Consi...
read more
Bit Magic
DSA
Bitwise-XOR
Minimizing Binary statements: Transforming a Binary String to all Zeroes
Last Updated: 07 November 2023
Given a set of N binary statements represented by a string S, where '1' represents a true statement and '0' represents a false one. You can perform the following operation...
read more
Strings
Bit Magic
Competitive Programming
DSA
binary-string
Bit Algorithms
Minimizing Bitwise-OR with XOR Operation on an Array
Last Updated: 29 November 2023
Given an array arr[] of non-negative integers where arr[i] = 0, the task is to select a non-negative integer 'k' and perform the bitwise-XOR operation on every element of ...
read more
Bit Magic
DSA
Arrays
Bitwise-XOR
Bitwise-OR
Minimum elements to be removed to make pairwise Bitwise XOR 0 or 1
Last Updated: 25 November 2023
Given an array X[] of length N. Then your task is to output the minimum number of elements needed to remove so that the Bitwise XOR of any pair is either 0 or 1.Examples:I...
read more
Bit Magic
Geeks Premier League
DSA
Arrays
Bitwise-XOR
Greedy Algorithms
Geeks Premier League 2023
DSA Tutorials
Maximizing Profits using Bitwise OR
Last Updated: 06 November 2023
Given two integers N, K and two integer arrays weights[] and profits[] each of size N where weights[i] is the weight associated with the ith item and profit[i] is the prof...
read more
Bit Magic
Recursion
DSA
Arrays
Arrays
Bitwise-OR
Count valid Bitwise operation combinations for Binary Strings
Last Updated: 07 November 2023
Given an odd integer N (N = 3), a binary string S of length N and another string O of length (N-1)/2. Here, each character in string O can be one of the following: '', '|'...
read more
Bit Magic
Competitive Programming
DSA
Bitwise-XOR
Bitwise-OR
Bitwise-AND
Maths
Maximum commulative XOR of elements with their indices
Last Updated: 29 November 2023
Given two integers N and K. Consider that there is an array A[] of 2N elements starting from 0. Then the task is to output the maximum cumulative XOR of elements with thei...
read more
Bit Magic
Geeks Premier League
DSA
Bitwise-XOR
Geeks Premier League 2023
Find two numbers whose difference is given as Binary string
Last Updated: 13 December 2023
Given a string S, which contains a certain number of 1s followed by a certain number of 0s. Then your task is to output the binary representation of two integers A and B b...
read more
Bit Magic
Geeks Premier League
DSA
binary-string
Geeks Premier League 2023
Find the coordinates of the fourth vertex of a square with given 3 vertices using XOR
Last Updated: 07 December 2023
Given the coordinates of three points in a plane, find the coordinates of the fourth point that forms a square, suppose take the first vertex as (x1, y1), the second verte...
read more
Bit Magic
Geometric
DSA
Coordinate Geometry
Bit Toggling to Minimize Array Sum
Last Updated: 04 December 2023
Given an array arr[] consisting of positive integers of size N. the task is to minimize the overall sum of arr[] by toggling the unset bit (0 bit) of any element of the ar...
read more
Bit Magic
Geeks Premier League
DSA
Algorithms-Greedy Algorithms
Geeks Premier League 2023
Check valid Substring of at least k length
Last Updated: 05 December 2023
Given a string s ('a' = s[i] = 'z') and an integer k (1 = k n = 105), the task is to check if any valid substrings of at least k length exist in the given string. A subst...
read more
Bit Magic
Geeks Premier League
DSA
Geeks Premier League 2023
XOR of Bitwise OR Pairs from Two Arrays
Last Updated: 31 December 2023
Given two integer arrays A[] and B[] of size N and M respectively. Another array C is formed of size N*M, containing Bitwise OR of all possible pairs of elements of A with...
read more
Bit Magic
Picked
DSA
Basic Coding Problems
Bitwise-XOR
Bitwise-OR
1
2
3
4
...
81
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 !
Bit Magic Archives - GeeksforGeeks