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 »
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 »