Sudhir sharma has Published 1206 Articles

Find the k-th smallest divisor of a natural number N in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 08:20:50

335 Views

In this problem, we are given two integer values N and k. Our task is to find the k-th smallest divisor of a natural number N.Let's take an example to understand the problem, Input : N = 15, k = 3 Output : 5Explanation −Factors of 15 are 1, 3, ... Read More

Find the k smallest numbers after deleting given elements in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 08:07:45

115 Views

In this problem, we are given an array arr[] of size n, array del[] of size m, and an integer k. Our task is to find the k smallest numbers after deleting the given elements.We need to print the first k smallest elements from the array arr[] found after deleting ... Read More

Find the k largest numbers after deleting the given elements in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:46:25

182 Views

In this problem, we are given an array arr[] of size n, array del[] of size m, and an integer k. Our task is to find the k largest numbers after deleting the given elements.We need to print the first k largest elements from the array arr[] found after deleting ... Read More

Find the Initial Array from given array after range sum queries in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:37:49

197 Views

In this problem, we are given an array res[] of size N. Our task is to find the Initial Array from given array after range sum queries.We need to find the starting array which will return the array rel[] on performing [s, e, val] query on it.Each [s, e, val] ... Read More

Find the index of first 1 in an infinite sorted array of 0s and 1s in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:32:17

406 Views

In this problem, we are given an infinite array bin[] consisting of boolean values (only 0's and 1's) in sorted order. Our task is to find the index of first 1 in an infinite sorted array of 0's and 1's.Here, we have an infinite array which guarantees that there exists ... Read More

Find the index of the left pointer after possible moves in the array in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:32:10

96 Views

In this problem, we are given an array arr[] of size N. Our task is to find the index of the left pointer after possible moves in the array.We have two pointers for the array, one left pointer and another right pointer.Left pointer starts at index 0 and the value ... Read More

Find the index of first 1 in a sorted array of 0's and 1's in C++

sudhir sharma

sudhir sharma

Updated on 28-Jan-2022 07:20:11

394 Views

In this problem, we are given an array bin[] consisting of boolean values (only 0's and 1's) in sorted order. Our task is to find the index of first 1 in a sorted array of 0's and 1's.Let's take an example to understand the problem, Input : bin[] = {0, ... Read More

Find the hypotenuse of a right angled triangle with given two sides in C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 11:07:53

1K+ Views

In this problem, we are given two integer values H and B defining height and base of a right angled triangle. Our task is to find the hypotenuse of a right angled triangle with given two sides.Right Angled Triangle is a special triangle whose two angles are at right angles.Let's ... Read More

Find the good permutation of first N natural numbers C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 11:01:35

170 Views

In this problem, we are an integer value N. Our task is to find the good permutation of first N natural numbers.permutation is an arrangement of all or part of a set of objects, with regard to the order of the arrangement.Good Permutation is a permutation in which $1\leqslant{i}\leqslant{N}$ and ... Read More

Find the first repeating element in an array of integers C++

sudhir sharma

sudhir sharma

Updated on 27-Jan-2022 10:59:12

378 Views

In this problem, we are an array arr of n integer values. Our task is to find the first repeating element in an array of integers.We need to find the first integer value from the array which occurred more than once in the array.Let's take an example to understand the ... Read More

Advertisements