Sudhir sharma has Published 1149 Articles

Find the number of points that have atleast 1 point above, below, left or right of it in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 13:24:34

148 Views

In this problem, we are given N points that lie in a 2D plane. Our task is to find the number of points that have at least 1 point above, below, left or right of it.We need to count all the points that have at least 1 point which satisfies ... Read More

Find the number of operations required to make all array elements Equal in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 13:18:46

397 Views

In this problem, we are given an array arr of size n. Our task is to Find the number of operations required to make all array elements EqualThe operation is defined as distribution of equal weights from the element with maximum weight to all the elements of the array.If it ... Read More

Find the n-th binary string in sorted order in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 13:09:51

158 Views

In this problem, we are given a positive number of 1. Our task is to find the Nth binary string in sorted order.We need to find the Nth string in an infinite list of strings created using only two symbols a and b sorted in lexicographical order.The list is −a, ... Read More

Find the maximum value permutation of a graph in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 13:05:33

232 Views

In this problem, we are given a graph of N nodes. Our task is to Find the maximum possible value of the minimum value of the modified array.For the graph we have a permutation of nodes which is the number of induces with minimum 1 node on the left of ... Read More

Find the maximum possible value of the minimum value of modified array in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 12:57:38

432 Views

In this problem, we are given an array arr[] of size n and a number S. Our task is to Find the maximum possible value of the minimum value of the modified array.Here, are the rules to modify the array, The difference between the sum of the array elements before ... Read More

Maximum occurrence of prefix in the Array in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 12:49:31

254 Views

In this problem, we are given an array of characters all in lowercase. Our task is to Maximum occurrence of prefix in the Array.We need to count the occurrence of non-empty prefixes whose occurrence count is maximum.Let’s take an example to understand the problem, Input : string = “xyyzkxyyzk” Output ... Read More

Find the number of divisors of all numbers in the range [1, n] in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 12:46:16

838 Views

In this problem, we are given a number N. Our task is to find the number of divisors of all numbers in the range [1, n].Let’s take an example to understand the problem, Input : N = 7 Output : 1 2 2 3 2 4 2Solution ApproachA simple solution ... Read More

Find the number of different numbers in the array after applying the given operation q times in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 12:36:02

181 Views

In this problem, we are given a number N which is the size of an array consisting of all zeros and Q queries each of the following type −update(s, e, val ) -> this query will update all elements from s to e (both inclusive) to val.Our task is to ... Read More

Find the number of boxes to be removed in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 12:26:25

205 Views

In this problem, we are given an array arr[] in which each element represents a pile of boxes (each of unit height). Our task is to find the number of boxes to be removed.The person is standing at index 0 of the array at the height of the pile of ... Read More

Find the Nth term of the series 9, 45, 243,1377…in C++

sudhir sharma

sudhir sharma

Updated on 24-Jan-2022 12:18:13

194 Views

In this problem, we are given an integer value N.Our task is to Find the nth term of the series −9, 45, 243, 1377, 8019, …Let’s take an example to understand the problem, Input : N = 4 Output : 1377Solution ApproachA simple solution to find the problem is by ... Read More

Advertisements