Arnab Chakraborty has Published 4452 Articles

C++ Program to find pairs of sequences where sequence holds minimum and maximum elements

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:23:37

265 Views

Suppose we have three numbers N, M and K. There are N horizontal rows and M vertical rows. We shall write an integer in between 1 and K on each cell, and define sequences A and B, such that −for each i in range 1 to N, A[i] is minimum ... Read More

C++ Program to find out if a palindromic matrix can be made from a given matrix

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:18:46

313 Views

Suppose, we are given a matrix with dimensions h x w. The matrix contains English letters. We have to create another matrix that will contain palindromic rows and columns, i.e. each row and column would be palindromes. To do that, any arrangement of rows and columns can be done from ... Read More

C++ Program to find out number of employees of different skill level to be transferred

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:13:44

145 Views

Suppose, there are n employees in a company. Each of the employees is given a rank based on their skills. The ranks are numbered from 1 to k. The number of employees having a rank i is given in the array skill, where skill[i] represents the number of employees having ... Read More

C++ Program to find out the minimum difference value in n integer pairs

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:09:42

164 Views

Suppose, we are given two arrays a and b that have a total of n and m values in them respectively. We have to make n or m number of pairs (whichever is minimum) using values from the two arrays. A pair must contain a value from array a and ... Read More

C++ Program to find out the sum of shortest cost paths for all given triplets

Arnab Chakraborty

Arnab Chakraborty

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

229 Views

Suppose, there are n cities and m roads between the cities. The m roads are given to us in an array of roads where the roads are in the format {aource, destination, weight}. Now, we define a triplet (s, t, k) where s, t, and k are cities. Now we ... Read More

C++ program to find out the shortest cost path in a given graph for q queries

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 11:00:37

429 Views

Suppose, we are given a graph that contains n vertices and is minimally connected. The edges are given to us an array where the edges are given in a {source, dest, weight} format. Now, we are given q number of queries where each query is of the format {source, destination}. ... Read More

C++ Program to find out the number of operations to maximize the number of even-numbered cells in a grid

Arnab Chakraborty

Arnab Chakraborty

Updated on 02-Mar-2022 10:56:05

72 Views

Suppose, we are given a grid of dimensions h * w. Every cell in the grid has a specific value assigned to it. We have to maximize the cells having an even value. To do that, we can select a cell that has not been selected before, and then decrease ... Read More

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

230 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

301 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

180 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

Advertisements