## std::unary_negate() in C++ with Examples

The std::unary_negate() is a wrapper function object returning the complement of the unary predicate it holds. A wrapper function is a subroutine in a software… Read More »

- Find XOR of all elements in an Array
- Count of subarrays of an Array having all unique digits
- Check if a Number is Odd or Even using Bitwise Operators
- Bitwise AND of all the elements of array
- Count number of binary strings without consecutive 1’s : Set 2
- Program to find the Nth natural number with exactly two bits set
- XOR of every element of an Array with a given number K
- Partition of a set into K subsets with equal sum using BitMask and DP
- XOR of elements in a given range with updates using Fenwick Tree
- Bitwise XOR of a Binary array
- Find a Mother vertex in a Graph using Bit Masking
- Count of pairs whose bitwise AND is a power of 2
- Count maximum occurrence of subsequence in string such that indices in subsequence is in A.P.
- Check if left and right shift of any string results into given string
- Count subarrays with sum equal to its XOR value
- Maximum number of set bits count in a K-size substring of a Binary String
- Number of subsets with same AND, OR and XOR values in an Array
- Largest number in the Array having frequency same as value
- Find the largest number smaller than integer N with maximum number of set bits
- Count of binary strings of length N having equal count of 0's and 1's
- Count of subarrays of size K with elements having even frequencies
- XOR of pairwise sum of every unordered pairs in an array
- Find a number such that maximum in array is minimum possible after XOR
- Sum of bit differences for numbers from 0 to N
- Remove all even parity nodes from a Doubly and Circular Singly Linked List
- Maximum weighted edge in path between two nodes in an N-ary tree using binary lifting
- Bitwise operations on Subarrays of size K
- Find the remainder when N is divided by 4 using Bitwise AND operator
- Find the length of the Largest subset such that all elements are Pairwise Coprime
- Turn off the rightmost set bit | Set 2

The std::unary_negate() is a wrapper function object returning the complement of the unary predicate it holds. A wrapper function is a subroutine in a software… Read More »

Given a binary string S, and an integer K, the task is to find the minimum number of flips required such that every substring of… Read More »

Given a number N, the task is to write C program to count the number of 0s and 1s in the binary representation of N.… Read More »

Given a binary string S of size N and an integer K. The task is to find the maximum number of set bit appears in… Read More »

Given a positive integer N, the task is to check whether the binary equivalent of that integer ends with “001” or not. Print “Yes” if… Read More »

Given an array of positive integers, the task is to find the minimum number of insertions to be done in the array, to make the… Read More »

Given three integers N, K and X, the task is to construct an array of length N, in which XOR of all elements of each… Read More »

Given an array arr[] containing N elements, the task is to count the number of sub-arrays whose XOR of all the elements is equal to… Read More »

Given two numnbers A and B, the task is to perform BCD Addition of the given numbers. Examples: Input: A = 12, B = 20… Read More »

A mother vertex in a Graph G = (V, E) is a vertex v such that a path from v can reach all other vertices… Read More »

Given an array A[] of integers and array Q consisting of queries of the following two types: (1, L, R) : Return XOR of all… Read More »

Given an array arr[] consisting of N elements and Q queries represented by L, R, and K. The task is to print the count of… Read More »

Given an N-ary tree with weighted edge and Q queries where each query contains two nodes of the tree. The task is to find the… Read More »

Given a binary string S, the task is to partition the sequence into K non-empty subsets such that the sum of products of occurences of… Read More »

Given three integers P, Q, and R, the task is to generate a binary string with P, Q and R pairs of consecutive characters with… Read More »