Arnab Chakraborty has Published 4452 Articles

C++ program to find minimum number of operations needed to make all cells at r row c columns black

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:42:15

174 Views

Suppose we have two numbers r, c and a grid of size n x m. Some cells are in black and remaining are white. In one operation, we can select some black cells and can do exactly one of these two −Color all cells in its row black, orcolor all ... Read More

C++ program to find maximum how many chocolates we can buy with at most k rupees

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:28:13

367 Views

Suppose we have an array A with n elements, and other values l, r and k are there. Amal wants to buy chocolates and he will not buy too expensive chocolates, and not also too cheap chocolates. In the store, there are n different chocolate bars and the prices are ... Read More

C++ program to count number of steps needed to make sum and the product different from zero

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:24:13

216 Views

Suppose we have an array A with n elements. In one operation, we can add 1 with any one element preset in A. If either the sum or the product of all elements in the array is equal to zero, We can do this operation one more time. We have ... Read More

C++ program to find minimum number of punches are needed to make way to reach target

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:22:12

230 Views

Suppose we have a matrix containing H rows and W columns. The cells either holds '.' or '#'. The dot '.' indicates passable space, and '#' indicates block. Amal will go from his house to a market. His house is in the cell at the top-left corner, and the market ... Read More

C++ program to find maximum profit we can make by making hamburger and chicken burgers

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:20:46

276 Views

Suppose we have five numbers b, p, f, h and c. There are two types of burgers in a restaurant. These are hamburger and chicken burger. Hamburger needs two buns and a beef patty and for chicken burger we need two buns and a chicken cutlet. We have b buns, ... Read More

C++ program to check we can place dominos on colored cells in correct order or not

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:17:10

106 Views

Suppose we have five numbers n, k1, k2, w and b. There is a board with 2 x n cells and first k1 cells in the first row, first k2 cells in second row are colored in white. All other cells are black. We have w white dominos and b ... Read More

C++ program to find number of groups can be formed from set of programmers

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:12:58

352 Views

Suppose we have an array A with n elements. The A[i] represents the programming skill of ith student. All elements in A are distinct. We want to split them into teams in such a way that −No two students i and j, such that |A[i] - A[j]| = 1 belong ... Read More

C++ program to find minimum possible number of keyboards are stolen

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:09:53

337 Views

Suppose we have an array A with n elements. There was an electronic store, where a robbery has done on the last night. All keyboards which were present inside the store were numbered in ascending order from some integer number x. For example, for x=4 and there were 3 keyboards ... Read More

C++ program to find two numbers from two arrays whose sum is not present in both arrays

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:06:56

105 Views

Suppose we have two arrays A with n elements and B with m elements. Select some element a form A and some element b from B, such that a + b does not belong to A or B.So, if the input is like A = [3, 2, 2]; B = ... Read More

C++ program to find maximum possible value for which XORed sum is maximum

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 06:04:10

157 Views

Suppose we have two numbers a and b. We have to find the smallest possible value of (a XOR x) + (b XOR x) for some value of x.So, if the input is like a = 6; b = 12, then the output will be 10, because if x = ... Read More

Advertisements