Sunidhi Bansal has Published 1085 Articles

Count number of smallest elements in given range in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Aug-2020 08:37:30

291 Views

We are given an array of integers of size N. Variables L and R define a range between 1 and N. The goal is to find the number of smallest elements that lie in range L and R such that L>=1 and R

Count number of primes in an array in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Aug-2020 08:33:54

10K+ Views

We are given with an array of numbers. The goal is to find the count of prime numbers in that array.A prime number is the one which is divisible by 1 and the number itself. It has only two factors. We will check if the number is prime starting from ... Read More

Maximize profit when divisibility by two numbers have associated profits in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Aug-2020 08:30:31

137 Views

We are given with five integers N, A, B, X and Y. The goal is to maximize the profit by checking that between numbers in range [ 1 to N ] , ifA number is divisible by A, then profit increases by X.A number is divisible by B then profit ... Read More

Maximum number of partitions that can be sorted individually to make sorted in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Aug-2020 08:27:47

665 Views

We are given with an array of N numbers with elements lying in range 0 and N-1. The elements are unsorted. The goal is to find the maximum number of partitions of the array which can be sorted individually and then can be concatenated to make a whole sorted array ... Read More

Maximum number with same digit factorial product in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:26:44

160 Views

Given the task is to find the maximum number without any leading or trailing zeroes or ones whose product of factorial of its digits is equal to the product of factorial of digits of the given number N.Let’s now understand what we have to do using an example −Input − ... Read More

Maximum number that can be display on Seven Segment Display using N segments in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:24:08

359 Views

Given the task is to find the maximum number that can be displayed using N segment on ant number of seven segment display.Let’s now understand what we have to do using an example −Input − N=5Output − 71Explanation − The largest number will be displayed as follows on the seven ... Read More

Maximum number of Zombie processes a system can handle in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:21:18

203 Views

Given the task is to find the maximum number of Zombie processes that a system can handle or in other words, the program does not stop its execution.A Zombie process (also known as defunct process) is a process that has completed its process via exit() (system call) but still has ... Read More

Maximum number of unique prime factors in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:20:03

1K+ Views

Given the task is to find the maximum number of unique prime factors a number can have in the range of [1, N] where N is given.Let’s now understand what we have to do using an example −Input − N=100Output − 3Explanation − Let us take 30 in the range ... Read More

Maximum number of trailing zeros in the product of the subsets of size k in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:18:22

249 Views

Given the task is to find the maximum number of trailing zeroes in the product of the subsets of size K, of a given array of size N.Let’s now understand what we have to do using an example −Input − Arr[] = {5, 20, 2} , K=2Output − 2Explanation − ... Read More

Maximum number of segments of lengths a, b and c in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:16:11

284 Views

Given the task is to find the maximum number of line segments of lengths a, b and c that can be formed from given positive integer N.Let’s now understand what we have to do using an example −Input − N=8, a=3, b=1, c=2Output − 8Explanation − N can be divided ... Read More

Advertisements