Arnab Chakraborty has Published 4452 Articles

C++ Program to find out the maximum amount of money that can be made from selling cars

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 07:17:43

208 Views

Suppose, there is a demand for red and blue cars for sale. An automobile company decides to sell p red cars and q blue cars of different prices. Currently, the company has 'a' number of red cars, 'b' number of blue cars, and 'c' numbers of colorless cars (the cars ... Read More

C++ program to check if two images match after rotation and translation

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 07:09:04

171 Views

Suppose, there are two n * n pixel square images first and second. The pixels can either be black or white. The images are given in a matrix representation where if a pixel is black it is represented as 'x' and if it is white, it is represented as '.'. ... Read More

C++ Program to find out the maximum amount of score that can be decreased from a graph

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 06:59:39

221 Views

Suppose, there is a weighted, undirected graph that has n vertices and m edges. The score of the graph is defined as the addition of all the edges weights in the graph. The edge weights can be negative, and if they are removed the score of the graph increases. What ... Read More

C++ Program to find out the number of cells to block in a grid to create a path

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 06:54:00

316 Views

Suppose, there is a grid of dimensions h * w. There is a robot in cell position (0, 0) and it has to go to the position (h - 1, w - 1). There are two types of cells in a grid, blocked and unblocked. The robot can pass through ... Read More

C++ to perform certain operations on a sequence

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 06:47:04

316 Views

Suppose, we are given an empty sequence and n queries that we have to process. The queries are given in the array queries and they are in the format {query, data}. The queries can be of the three following types−query = 1: Add the supplied data to the end of ... Read More

C++ Program to find out the maximum number of moves to reach a unblocked cell to another unblocked cell in a grid

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 06:37:29

244 Views

Suppose, we are given a grid of dimensions h * w that contains two types of cells, blocked and unblocked. Blocked cells mean that the cells aren't accessible and unblocked means that the cells are accessible. We represent the grid in a 2D array where the blocked cells are given ... Read More

C++ Program to check cats words are right or not with colored hats

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Feb-2022 13:16:39

125 Views

Suppose we have an array A with N elements. Consider there are N cats and they are numbered from 1 to N. Each cat is wearing a hat and ith cat says "there are exactly A[i] number of different colors among the N-1 hats owned by the cats except me". ... Read More

C++ program to check we can buy product with given money or not

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Feb-2022 13:02:27

172 Views

Suppose we have a number N. A cake seller is selling cakes with 40 rupees, and doughnuts with 70 rupees each. We have to check whether we can buy some of them with exactly N rupees or not.So, if the input is like N = 110, then the output will ... Read More

C++ Program to check we can remove all stones by selecting boxes

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Feb-2022 12:57:26

105 Views

Suppose we have an array A with N elements. Consider there are N boxes and they are arranged in a circle. The ith box contains A[i] stones. We have to check whether we can remove all stones from the boxes by repeatedly performing the operation: Select a box say ith ... Read More

C++ program to find last value of matrix with given constraints

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Feb-2022 12:51:54

107 Views

Suppose we have a list of numbers A with N elements in it. The elements are 1, 2 or 3, Consider a number X[1][j] = A[j] where j is in range 1 to N. And X[i][j] = |X[i-1][j] - X[i-1][j+1]| where i is in range 2 to N and j ... Read More

Advertisements