## Find all possible triangles with XOR of sides zero

Given an integer N, we need to find three integers(X, Y, Z) which can form a triangle with the following conditions: Lengths of sides are… Read More »

Given an integer N, we need to find three integers(X, Y, Z) which can form a triangle with the following conditions: Lengths of sides are… 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 »

You are given two positive integer n and k. You have to calculate the maximum possible XOR value of at most k-elements from 1 to… Read More »

Given two numbers say a and b. Print their XOR after making the lengths of their binary representation equal by adding trailing zeros to the… Read More »

Let us consider the following problem to understand Segment Trees. We have an array arr[0 . . . n-1]. We should be able to 1… Read More »

Given an array of n integers, find the sum of xor of all pairs of numbers in the array. Examples : Input : arr[] =… Read More »

Given two integer numbers, whenever the bits of the first number is set i.e. 1, toggle the bits of the second number leaving the rest… Read More »

Given four positive integers, determine if there’s a rectangle such that the lengths of its sides are a, b, c and d (in any order).… Read More »

Given an array of size N. Find the number of pairs (i, j) such that XOR = 0, and 1 <= i < j <=… Read More »

Given a number, the task is to Toggle all even bit of a number Examples: Input : 10 Output : 0 binary representation 1 0… Read More »

Given a number n, the task is to toggle only first and last bits of a number Examples: Input : 10 Output : 3 Binary… Read More »

Given an array of size n. It is also given that range of numbers is from smallestNumber to smallestNumber + n where smallestNumber is the… Read More »

Given an positive integer n and k. Find maximum xor of 1 to n using at most k numbers. Xor sum of 1 to n… Read More »

XNOR gives the reverse of XOR if binary bit. First bit | Second bit | XNOR 0 0 1 0 1 0 1 0 0… Read More »

Consider an arr[] which can be defined as: You are given Q queries of the form [l, r]. The task is to output the value… Read More »