Ayush Gupta has Published 541 Articles

Count all pairs with given XOR in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 11:07:13

186 Views

In this tutorial, we will be discussing a program to find the number of pairs with the given XOR.For this we will be provided with an array and a value. Our task is to find the number of pairs whose XOR is equal to the given value.Example#include using namespace std; ... Read More

Count all pairs of an array which differ in K bits in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 10:55:19

115 Views

In this tutorial, we will be discussing a program to find the number of pairs of an array which differ in K bits.For this we will be provided with an array and an integer K. Our task is to find the number of pairs who differ by K bits in ... Read More

Count all pairs of adjacent nodes whose XOR is an odd number in C++

Ayush Gupta

Ayush Gupta

Updated on 10-Feb-2020 10:50:15

84 Views

In this tutorial, we will be discussing a program to find the number of pairs of adjacent nodes whose XOR is an odd number.For this we will be provided with a binary tree. Our task is to count the number of pairs of adjacent elements whose XOR is an odd ... Read More

Count numbers from 1 to n that have 4 as a digit in C++

Ayush Gupta

Ayush Gupta

Updated on 05-Feb-2020 07:57:50

337 Views

In this tutorial, we will be discussing a program to find the numbers from 1 to n that have 4 as a digit.For this we will be provided with a number n. Our task is to count all the numbers which have 4 as one of their digits and print ... Read More

Count number of even and odd elements in an array in C++

Ayush Gupta

Ayush Gupta

Updated on 05-Feb-2020 07:53:52

520 Views

In this tutorial, we will be discussing a program to find the number of even and odd elements in an array.For this we will be provided with an array. Our task is to calculate the number of even and odd elements in the given array.Example Live Demo#include using namespace std; void ... Read More

Count all increasing subsequences in C++

Ayush Gupta

Ayush Gupta

Updated on 05-Feb-2020 07:49:01

387 Views

In this tutorial, we will be discussing a program to find the number of increasing sequences.For this we will be provided with an array containing digits 0 to 9. Our task is to count all the sequences present in the array such that the next element is greater than the ... Read More

Count all elements in the array which appears at least K times after their first occurrence in C++

Ayush Gupta

Ayush Gupta

Updated on 05-Feb-2020 07:45:38

193 Views

In this tutorial, we will be discussing a program to find the number of elements in the array which appears at least K times after their first occurrence.For this we will be provided with an integer array and a value k. Our task is to count all the elements occurring ... Read More

Count all distinct pairs with difference equal to k in C++

Ayush Gupta

Ayush Gupta

Updated on 05-Feb-2020 07:41:45

158 Views

In this tutorial, we will be discussing a program to find the distinct pairs with difference equal to k.For this we will be provided with an integer array and the value k. Our task is to count all the distinct pairs that have the difference as k.Example Live Demo#include using namespace ... Read More

Count all 0s which are blocked by 1s in binary matrix in C++

Ayush Gupta

Ayush Gupta

Updated on 05-Feb-2020 07:38:38

209 Views

In this tutorial, we will be discussing a program to find the count of 0s which are blocked by 1s in a binary matrix.For this we will be provided with a binary matrix. Our task is to find and count all the 0s in the matrix that are blocked by ... Read More

Count 1’s in a sorted binary array in C++

Ayush Gupta

Ayush Gupta

Updated on 05-Feb-2020 07:32:28

98 Views

In this tutorial, we will be discussing a program to find the 1’s in a sorted binary array.For this we will be provided with an array containing only 1 and 0. Our task is to count the number of 1’s present in the array.Example Live Demo#include using namespace std; //returning ... Read More

Advertisements