## Maximum XOR value in matrix

Given a square matrix (N X N), the task is to find the maximum XOR value of a complete row or a complete column. Examples… Read More »

## Calculate XOR from 1 to n.

Given a number n, the task is to find the XOR from 1 to n. Examples : Input : n = 6 Output : 7… Read More »

## Multiples of 4 (An Interesting Method)

Given a number n, the task is to check whether this number is a multiple of 4 or not without using +, -, * ,/… Read More »

## Equal Sum and XOR

Given a positive integer n, find count of positive integers i such that 0 <= i <= n and n+i = n^i Examples : Input… Read More »

## Minimax Algorithm in Game Theory | Set 5 (Zobrist Hashing)

Previous posts on this topic : Minimax Algorithm in Game Theory, Evaluation Function in Game Theory, Tic-Tac-Toe AI – Finding optimal move, Alpha-Beta Pruning. Zobrist… Read More »

## Swap three variables without using temporary variable

Given three variables, a, b and c, swap them without temporary variable. Example : Input : a = 10, b = 20 and c =… Read More »

## Active and Inactive cells after k Days

Given a binary array of size n where n > 3. A true (or 1) value in the array means active and false (or 0)… Read More »

## Find Two Missing Numbers | Set 2 (XOR based solution)

Given an array of n unique integers where each element in the array is in range [1, n]. The array has all distinct elements and… Read More »

## Inplace Operators in Python | Set 2 (ixor(), iand(), ipow(),…)

Inplace Operators in Python | Set 1(iadd(), isub(), iconcat()…) More functions are discussed in this articles. 1. ixor() :- This function is used to assign… Read More »

## Generate 0 and 1 with 25% and 75% probability

Given a function rand50() that returns 0 or 1 with equal probability, write a function that returns 1 with 75% probability and 0 with 25%… Read More »

## Find even occurring elements in an array of limited range

Given an array that contains odd number of occurrences for all numbers except for a few elements which are present even number of times. Find… Read More »

## How to sum two integers without using arithmetic operators in C/C++?

Given two integers a and b, how can we evaluate the sum a + b without using operators such as +, -, ++, –, …?… Read More »

## Bitwise Hacks for Competitive Programming

It is recommended to refer Interesting facts about Bitwise Operators as a prerequisite. 1. How to set a bit in the number ‘num’ : If… Read More »

## Find lost element from a duplicated array

Given two arrays which are duplicates of each other except one element, that is one element from one of the array is missing, we need… Read More »

## Gray to Binary and Binary to Gray conversion

Binary Numbers is default way to store numbers, but in many applications binary numbers are difficult to use and a variation of binary numbers is… Read More »