## Reverse bytes of a Hexadecimal Number

Given an unsigned integer N. The task is to reverse all bytes of N without using a temporary variable and print the reversed number. Examples:… Read More »

- Minimize the number of steps required to reach the end of the array
- Minimum Bitwise OR operations to make any two array elements equal
- Find array such that no subarray has xor zero or Y
- Print steps to make a number in form of 2^X - 1
- Check if matrix A can be converted to B by changing parity of corner elements of any submatrix
- Count of numbers whose 0th and Nth bits are set
- Find the value at kth position in the generated array
- Total distinct pairs from two arrays such that second number can be obtained by inverting bits of first
- Smallest number greater or equals to N such that it has no odd positioned bit set
- Reverse bytes of a Hexadecimal Number

Given an unsigned integer N. The task is to reverse all bytes of N without using a temporary variable and print the reversed number. Examples:… Read More »

Given two integers X (1 ≤ X ≤ 15) and Y. The task is to find an array of the maximum possible length N such… Read More »

Given an array arr[] of integers and an integer K, we can perform the Bitwise OR operation between any array element and K any number… Read More »

Given an integer N, the task is to find the smallest integer X such that it has no odd position set and X ≥ N.… Read More »

Given a positive integer N, the task is to count the numbers that can be represented with N bits and whose 0th and Nth bits… Read More »

Given an integer array arr[] of length N consisting of positive integers, the task is to minimize the number of steps required to reach the… Read More »

Given a number N, there are two steps to be performed. At odd step, XOR the number with any 2^M-1, where M is chosen by… Read More »

Given two binary matrices A[][] and B[][] of N X M. In a single operation, one can choose a sub-matrix (min of 2 rows and… Read More »

Given three integer n, m and k. Find the element at kth position after repeating the given operation n number of times. In a single… Read More »

Given two arrays arr1[] and arr2[], the task is to take an element from first array (say a) and one element from second array (say… Read More »

Given an array arr[], the task is to find the minimum number of elements that must be removed to make the array good. A sequence… Read More »

Given a number N, the task is to find a positive number M such that gcd(N^M, N&M) is the maximum possible and M < N.… Read More »

Given a number X, the task is to find the minimum number N such that total set bits of all numbers from 1 to n… Read More »

Given two integers(less than 2^31) A and B. The task is to find the number of bits that are different in their binary representation. Examples:… Read More »

Given a non-negative number and two values and . The problem is to check whether or not N has an alternate pattern in its binary… Read More »