Ayush Gupta has Published 541 Articles

Find three integers less than or equal to N such that their LCM is maximum in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:54:33

69 Views

In this tutorial, we will be discussing a program to find three integers less than or equal to N such that their LCM is maximum.For this we will be provided with an integer value. Our task is to find other three integers smaller than the given value such that their ... Read More

Queries to return the absolute difference between Lth smallest number and the R-th smallest number in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:53:41

98 Views

In this tutorial, we will be discussing a program to find queries to return the absolute difference between L-th smallest number and the R-th smallest number.For this we will be provided with an array containing integers and Q queries. Our task is to find the absolute difference between the indices ... Read More

Querying the number of distinct colors in a subtree of a colored tree using BIT in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:51:40

138 Views

In this tutorial, we will be discussing a program to find querying the number of distinct colors in a subtree of a colored tree using BIT.For this we will be provided with rooted tree where each node has a color denoted by given array. Our task is to find all ... Read More

Queries to update a given index and find gcd in range in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:48:16

75 Views

In this tutorial, we will be discussing a program to find queries to update a given index and find gcd in range.For this we will be provided with an array containing integers and Q queries. Our task is to find the result of given queries (updating a given value by ... Read More

Find total number of distinct years from a string in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:45:52

2K+ Views

In this tutorial, we will be discussing a program to find total number of distinct years from a string.For this we will be provided with a string containing dates in format ‘DD-MM-YYYY’ format. Our task is to find the count of distinct years mentioned in the given string.Example Live Demo#include ... Read More

Find time taken for signal to reach all positions in a string in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:44:25

61 Views

In this tutorial, we will be discussing a program to find time taken for signal to reach all positions in a stringFor this we will be provided with a string containing ‘x’ and ‘o’. A signal originates from ‘x’ and travels in both directions changing one ‘o’ value in one ... Read More

Find two numbers with sum and product both same as N in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:42:22

129 Views

In this tutorial, we will be discussing a program to find two numbers with sum and product both same as N.For this we will be provided with an integer value. Our task is to find two other integer values whose product and sum is equal to the given value.Example Live Demo#include ... Read More

Find triplet such that number of nodes connecting these triplets is maximum in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:41:07

56 Views

In this tutorial, we will be discussing a program to find triplet such that number of nodes connecting these triplets is maximum.For this we will be provided with a tree with N nodes. Our task is to find a triplet of nodes such that the nodes covered in the path ... Read More

Find trace of matrix formed by adding Row-major and Column-major order of same matrix in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:38:48

89 Views

In this tutorial, we will be discussing a program to find trace of matrix formed by adding Row-major and Column-major order of same matrix.For this we will be provided with two arrays one in row-major and other in columnmajor. Our task is to find the trace of the matrix formed ... Read More

Find uncommon characters of the two strings in C++

Ayush Gupta

Ayush Gupta

Updated on 19-Aug-2020 10:36:14

99 Views

In this tutorial, we will be discussing a program to find uncommon characters of the two strings.For this we will be provided with two strings. Our task is to print out the uncommon characters of both strings in sorted order.Example Live Demo#include using namespace std; const int LIMIT_CHAR = 26; ... Read More

Advertisements