Ayush Gupta has Published 541 Articles

Count all possible walks from a source to a destination with exactly k edges in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:45:04

109 Views

In this tutorial, we will be discussing a program to find the number of walks from a source to a destination with exactly k edges.For this we will be provided with a graph and the values of source and destination. Our task is to find all the possible paths starting ... Read More

Count all prefixes of the given binary array which are divisible by x in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:40:52

83 Views

In this tutorial, we will be discussing a program to find the number of prefixes of the binary array which are divisible by x.For this we will be provided with binary array and a value x. Our task is to find the number of elements whose prefixes are divisible by ... Read More

Count all Quadruples from four arrays such that their XOR equals to ‘x’ in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:39:07

122 Views

In this tutorial, we will be discussing a program to find the number of quadruples from four arrays such that their XOR equals to x.For this we will be provided with four arrays and a value x. Our task is to count all the quadruples whose XOR is equal to ... Read More

Count all Prime Length Palindromic Substrings in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:36:09

132 Views

In this tutorial, we will be discussing a program to find the number of prime length palindromic strings.For this we will be provided with a string. Our task is to count all the sub strings which are palindromes and have prime lengths.Example Live Demo#include using namespace std; //checking for a ... Read More

Count all sub-arrays having sum divisible by k

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:33:19

177 Views

In this tutorial, we will be discussing a program to find the number of sub-arrays having sum divisible by k.For this we will be provided with an array and a value k. Our task is to find the number of sub arrays that are having their sum as equal to ... Read More

Count all sorted rows in a matrix in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:27:25

143 Views

In this tutorial, we will be discussing a program to find the number of all sorted rows in a matrix.For this we will be provided with m*n matrix. Our task is to count all the rows in the given matrix that are sorted either in ascending or descending order.Example Live Demo#include ... Read More

Count all the columns in a matrix which are sorted in descending in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:23:45

124 Views

In this tutorial, we will be discussing a program to find the number of columns in a matrix which are sorted in descending.For this we will be provided with a matrix. Our task is to count the number of columns in the matrix having elements sorted in descending order.Example Live Demo#include ... Read More

Count all the numbers in a range with smallest factor as K in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:20:56

85 Views

In this tutorial, we will be discussing a program to find the numbers in a range with the smallest factor as K.For this we will be provided with a range [a, b]. Our task is to count the numbers in the given range who have their smallest factor as K.Example Live ... Read More

Count all subsequences having product less than K in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:17:03

288 Views

In this tutorial, we will be discussing a program to find the number of sub sequences having product less than K.For this we will be provided with non-negative array and a value k. Our task is to find all the subsequences in the array having product less than k.Example Live Demo#include ... Read More

Handling the Divide by Zero Exception in C++

Ayush Gupta

Ayush Gupta

Updated on 17-Feb-2020 10:14:15

7K+ Views

In this tutorial, we will be discussing how to handle the divide by Zero exception in C++.Division by zero is an undefined entity in mathematics, and we need to handle it properly while programming so that it doesn’t return at error at the user end.Using the runtime_error classExample Live Demo#include ... Read More

Advertisements