# Category Archives: Bit Magic

Given a base 10 integer N, the task is to find the 1’s complement of this Base 10 Integer. Examples: Input: N = 5Output: 2Explanation:â€¦ Read More
Given a number N, the task is to find the longest range of integers [L, R] such that 1 â‰¤ L â‰¤ R â‰¤ Nâ€¦ Read More
Space complexity is the most underestimated asset by programmers. One can barely see a Memory Limit Exceed (MLE) while submitting a solution. But, saving memoryâ€¦ Read More
Given two integers N and K, The task is to find the count of all possible arrays of size N with maximum sum & bitwiseâ€¦ Read More
Given an integer N, find the oneâ€™s complement of the integer. Examples: Input: N = 5Output: 2Explanation: Binary representation of 5 is “101”. Its one’sâ€¦ Read More
Given an array queries[][] of Q range queries, the task is to find the minimum removals from the range[l, r] such that the bitwise ANDâ€¦ Read More
Given a number N. The task is to count the number of distinct XOR of any possible pairs using numbers from 1 to N inclusive.â€¦ Read More
Given a positive integer number N. The task is to generate all the binary numbers of N digits. These binary numbers should be in ascendingâ€¦ Read More
Given two positive integer numbers L and R. The task is to convert all the numbers from L to R to binary number. The lengthâ€¦ Read More
Given two positive integer numbers L and R. The task is to convert all the numbers from L to R to binary number.  Examples: Input:â€¦ Read More
N-Base modified Binary Search is an algorithm based on number bases that can be used to find an element in a sorted array arr[]. Thisâ€¦ Read More
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is saidâ€¦ Read More
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is saidâ€¦ Read More
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is saidâ€¦ Read More
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is saidâ€¦ Read More