Arnab Chakraborty has Published 4293 Articles

C++ Program to find out the maximum amount of profit that can be achieved from selling wheat

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 10:23:18

367 Views

Suppose, there is n number of cities that are connected with m roads. The roads are unidirectional, the roads can only go from source to destination and not the opposite. The roads are given in the array 'roads' in format {source, destination}. Now, in the cities, wheat is sold at ... Read More

C++ program to find out the number of ways a grid with boards can be colored

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 10:17:54

391 Views

Suppose, we are given a grid that has 2 rows and n columns. The grid has to be covered by n boards without one board getting over another. Now, the boards have to be colored by any one color between red, blue, and green. Two boards that are adjacent to ... Read More

C++ Program to find out the super vertices in a graph

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 10:14:19

274 Views

Suppose, we are given a graph that has n vertices. The vertices are numbered 1 to n, and they are connected by the edges given in the array 'edges'. Each vertex has an 'x' value within a number from 1 to n that is given in the array 'values'. Now, ... Read More

C++ program to find out the number of iterations needed to convert all cells to black

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 10:07:48

249 Views

Suppose, we are given a grid that contains two types of cells; black cells, and white cells. The black cells are represented as '#' and the white cells are represented as '.'. The grid is given to us in an array of strings. Now, we have to perform the following.We ... Read More

C++ program to find out the center coordinates and the height of a building

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 09:58:24

306 Views

Suppose, there is a building that has center coordinates xc, yc, and height h. We don't know the center coordinates of the building, but we are provided with n pieces of information that contain x and y coordinates and an altitude value a. The altitude of coordinates (x, y) is ... Read More

C++ program to find out the maximum possible tally from given integers

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 09:47:19

386 Views

Suppose, we are given two integers n and m and there are k tuples of integers that contain four integer numbers {ai, bi, ci, di}. Four arrays a, b, c, d are given, and a[i] signifies the i-th tuple's a value. Now, let us consider a sequence dp that has ... Read More

C++ program to find out the minimum amount of time needed to reach from source to destination station by train

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 09:43:38

434 Views

Suppose n stations are connected by m tracks. The stations are named from 1 to n. The tracks are bidirectional, and we have to reach station dest from station src. Thes source and destination stations of the i-th railroad is given in the array 'roads' where roads[i] is of the ... Read More

C++ program to find out the maximum number of cells that can be illuminated

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 09:38:22

262 Views

Suppose, we are given a grid of dimensions h * w. The cells in the grid can contain either a bulb or obstacles. A light bulb cell illuminates the cells in its right, left, up, and down and the light can shine through the cells unless an obstacle cell blocks ... Read More

C++ Program to find out the number of illuminated cells in a grid

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 08:12:53

213 Views

Suppose, we are given a grid of dimensions h * w. The cells in the grid can contain either bulbs or obstacles. A light bulb cell illuminates itself and the cells in its right, left, up, and down and the light can shine through the cells unless an obstacle cell ... Read More

C++ Program to find out the number of bridge edges in a given graph

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 08:05:16

481 Views

Suppose, we are given an unweighted, undirected graph that contains n vertices and m edges. A bridge edge in a graph is an edge whose removal causes the graph to be disconnected. We have to find out the number of such graphs in a given graph. The graph does not ... Read More

Advertisements