Sudhir sharma has Published 1149 Articles

Find longest length number in a string in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:13:50

440 Views

In this problem, we are given a string str consisting of character and alphabets only. Our task is to find the longest length number in a string. Problem Description: we need to find the length of the number i.e. consecutive numerical characters in the string.Let’s take an example to understand the problem, ... Read More

Find M-th number whose repeated sum of digits of a number is N in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:13:26

156 Views

In this problem, we are given two positive numbers N and M. Our task is to find the M-th number whose repeated sum of digits of a number is N. Problem description: Here, we need to find the Mth number whose sum of digits till the sum becomes single digit is equal ... Read More

Find max of two Rational numbers in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:12:19

197 Views

In this problem, we are given two Rational Numbers. Our task is to find max of two Rational numbers. Here, the rational numbers are in the form of p/q.Let’s take an example to understand the problem,  Input: rat1 = 5/4, rat2 = 3/2Output: 3/2Explanation: 5/4 = 1.253/2 = 1.5Solution Approach −A simple solution to ... Read More

Find letter's position in Alphabet using Bit operation in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:12:08

861 Views

In this problem, we are given a string str consisting of english alphabets. Our task is to find the letter's position in the Alphabet using the Bit operation. Problem Description: Here, we will return the position of each character of the string as it is in english alphabets.The characters of the string ... Read More

Find m-th summation of first n natural numbers in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:11:42

463 Views

In this problem, we are given two integers m and n. Our task is to Find m-th summation of the first n natural numbers. Problem Description: we will find sum of sum of n natural numbers m times. The sum is given by the formula, if (m > 1),       ... Read More

Find m-th smallest value in k sorted arrays in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:11:04

250 Views

In this problem, we are given k different arrays of different sizes. Our task is to find m-th smallest value in k sorted arrays. Problem Description: Here, we need to find m-th smallest element of the merged array of all k arrays.Let’s take an example to understand the problem,  Input:     ... Read More

Find length of the largest region in Boolean Matrix in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:05:38

630 Views

In this problem, we are given a 2-D matrix of size nXm consisting of 0’s and 1’s only. Our task is to find the length of the largest region in the Boolean Matrix. Problem Description: If a cell contains 1, it is a filled Cell. We need to find the length of connected ... Read More

Find length of loop in linked list in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:04:42

513 Views

In this problem, we are given a linked list that might contain loops. Our task is to find the length of the loop in the linked list. Problem Description: we need to count the number of nodes in the loop if it contains a loop otherwise return -1.Let’s take an example to ... Read More

Find length of Diagonal of Hexagon in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:03:38

210 Views

In this problem, we are given an integer n denoting the length of the side of a regular hexagon. Our task is to Find length of Diagonal of Hexagon.Problem Description: Here, we have the side of a regular hexagon. And we need to find the length of the diagonal of the ... Read More

Find last five digits of a given five digit number raised to power five in C++

sudhir sharma

sudhir sharma

Updated on 25-Jan-2021 05:00:05

280 Views

In this problem, we are given a number N. Our task is to find the last five digits of a given five digit number raised to power five. Let’s take an example to understand the problem,  Input: N = 25211Output:Solution ApproachTo solve the problem, we need to find only the last five ... Read More

Advertisements