Sudhir sharma has Published 1149 Articles

Find next greater number with same set of digits in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:34:42

1K+ Views

In this problem, we are given an element N. We need to find the next greater number with the same set of digits. We need to find the smallest number with the same digit which is greater than N.Let’s take an example to understand the problem, InputN = "92534"Output92543Solution ApproachA ... Read More

Find n’th number in a number system with only 3 and 4 in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:33:05

2K+ Views

In this problem, we are given an element N. we need to find the N’th number in a number system with only 3 and 4.The number system consists of elements 3, 4, 33, 34, 43, 44, 333, 334, 343, 344, …Let’s take an example to understand the problem, InputN = ... Read More

Find N’th item in a set formed by sum of two arrays in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:30:53

189 Views

In this problem, we are given two sorted arrays arr1[] and arr2[] of size m and an element N. Our task is to Find Nth item in a set formed by the sum of two arrays.Code description − Here, we will create a set that consists of the sum of element ... Read More

Find n-variables from n sum equations with one missing in C++

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:27:57

99 Views

In this problem, we are given an array sum[] consisting of a sum of (n-1) variables given as, Sum[1] = x2 + x3 + x4 + … xn Sum[2] = x1 + x3 + x4 + … xn . . Sum[i] = x2 + x3 + x4 + … x(i-1) ... Read More

C++ program to find n-th term of series 3, 9, 21, 41, 71…

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:26:14

269 Views

In this problem, we are given an integer N. The task is to find the n-th term in series 3, 9, 21, 41, 71...Let’s take an example to understand the problem, InputN = 7Output169ExplanationThe series is 3, 9, 21, 41, 71, 169...Solution ApproachA simple solution to the problem is by ... Read More

C++ program to find n-th term of series 2, 10, 30, 68, 130 …

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:24:30

3K+ Views

In this problem, we are given an integer N. The task is to find the n-th term in series 2, 10, 30, 68, 130...Let’s take an example to understand the problem, InputN = 7Output350ExplanationThe series is 2, 10, 30, 68, 130, 222, 350...Solution ApproachA simple solution to the problem is ... Read More

C++ program to find n-th term of series 1, 3, 6, 10, 15, 21…

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:22:37

619 Views

In this problem, we are given an integer N. The task is to find the n-th term in series 1, 3, 6, 10, 15, 21, 28....Let’s take an example to understand the problem, InputN = 7Output28ExplanationThe series is 1, 3, 6, 10, 15, 21, 28...Solution ApproachA simple solution to the ... Read More

C++ program to find n-th term of series 1, 4, 27, 16, 125, 36, 343...

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:20:32

535 Views

In this problem, we are given an integer N. The task is to find the n-th term in series 1, 4, 27, 16, 125, 36, 343....Let’s take an example to understand the problem, InputN = 7Output343ExplanationThe series is 1, 4, 27, 16, 125, 36, 343…Solution ApproachA simple solution to the ... Read More

C++ program to find n-th term in the series 9, 33, 73,129 …

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:19:06

395 Views

In this problem, we are given an integer N. The task is to find n-th term in series 9, 33, 73, 129....Let’s take an example to understand the problem, InputN = 4Output129ExplanationThe series upto nth term is 9, 33, 73, 129...Solution ApproachThe solution to the problem lies in finding the ... Read More

C++ program to find n-th term in the series 7, 15, 32, …

sudhir sharma

sudhir sharma

Updated on 13-Mar-2021 12:17:07

168 Views

In this problem, we are given an integer N. The task is to find n-th term in series 7, 15, 32....Let’s take an example to understand the problem, InputN = 6Output281ExplanationThe series upto nth term is 7, 15, 32, 67, 138, 281Solution ApproachThe solution to the problem lies in decoding ... Read More

Advertisements