Sunidhi Bansal has Published 1100 Articles

Maximum number of groups of size 3 containing two type of items in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:09:27

130 Views

Given the task is to calculate the maximum number of groups of size 3 that can be formed when N number of items of type A and M number of items of type B are given.Also, each group should have at least one item of each type, that is either ... Read More

Maximum number of dots after throwing a dice N times in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:07:36

110 Views

Given the task is to calculate the maximum number of dots that can be expected after throwing a dice N times having M faces.The first face of the dice contains 1 dot, the second face has 2 dots and so on. Likewise the M-th face contains M number of dots.The ... Read More

Maximize number of continuous Automorphic numbers in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 09:05:49

225 Views

Given the task is to maximize the number of continuous Automorphic elements in a given array with N number of elements.An automorphic number is a number whose square ends with the same digits as the number itself. For example 5 is an automorphic number as 5*5 = 25 and 25 ... Read More

Maximize the size of array by deleting exactly k sub-arrays to make array prime in C++

Sunidhi Bansal

Sunidhi Bansal

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

77 Views

Given the task is to delete exactly K sub-arrays from a given array Arr[] with N positive elements such that all the remaining elements in the array are prime and the size of the remaining array is maximum.Input Arr[]={4, 3, 3, 4, 3, 4, 3} , K=2Output 3Explanation − K=2, this means ... Read More

Maximize the sum of products of the degrees between any two vertices of the tree in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 08:59:08

248 Views

Given the task is to construct a tree with a given integer N such that, the sum of degree(x) * degree(y) for all ordered pairs (x, y) is maximum and x is not equal to y.Input −N=5Output −50Explanation    1     \      2       \   ... Read More

Maximum distinct lines passing through a single point in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 08:55:56

155 Views

We are given the number N and coordinates of two points (x1, y1) and (x2, y2) for each line. The goal is to find the maximum number of lines from given lines that can pass through a single point such that no two lines cover each other, and no rotation ... Read More

Maximum given sized rectangles that can be cut out of a sheet of paper in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 08:53:52

298 Views

We are given the dimensions of the sheet of paper, it’s Length L, and Breadth B. Also, we are given the dimensions of a small rectangle, it’s length l, and breadth b. The goal is to find the maximum number of smaller rectangles that can be cut out of a ... Read More

Maximum length of subarray such that sum of the subarray is even in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 08:52:38

796 Views

We are given with an array Arr[] of integers. The goal is to find longest length subarray of Arr[] , sum of whose elements is even. That is, the sum of elements of a subarray is even and that subarray is longest in length.Input − Arr[] = { 2, 3, ... Read More

Maximum number of candies that can be bought in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 08:50:11

655 Views

We are given an array of candies[] of length stored in ‘size’. Each element candies[i] has a number for candies of type i.The goal is to buy as many candies as possible for any amount of money. The conditions are as given −If you purchase X[i] of type i (0Read More

Maximum number of 2×2 squares that can be fit inside a right isosceles triangle in C

Sunidhi Bansal

Sunidhi Bansal

Updated on 17-Aug-2020 08:48:50

581 Views

We are given a right isosceles triangle. Isosceles triangle is the one which has two sides of equal length. Right triangle is the one which has height(ag in fig.) and base (dg in fig.) perpendicular to each other. The goal is to find the maximum number of squares that can ... Read More

Advertisements