Arnab Chakraborty has Published 4452 Articles

C++ Program to find out the total price

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 10:20:47

1K+ Views

Suppose, we have gone to a shop to buy three items. We have to buy two items of each kind. We have to buy items of prices b and d, but there is a choice between buying items of prices a and c. We buy the lowest priced item between ... Read More

C++ Program to find out the health of a character

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 10:18:20

229 Views

Suppose, we are playing a 2d scrolling game. The character of the game is currently located in position pos with health h. When the character proceeds in the game, he gains pos amount of health, and the pos value decreases in each step. Whenever the character encounters an obstacle at ... Read More

C++ Program to find and replace in a string

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 09:17:35

829 Views

Suppose, we are given a string s. There is a range, from start to end where start and end are both integers. Whenever we encounter the character stored in variable f within the given range, we replace it with the character stored in r. We find out the string after ... Read More

C++ Program to find out if there is a pattern in a grid

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 09:12:43

255 Views

Suppose, we are given a grid of dimensions n * n. We have to detect if there is a cross pattern in the grid, like below −#...# .#.#. ..#.. .#.#. #...#The grid can only contain '#' and '.'. We have to detect the pattern and find out how many such ... Read More

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

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 09:06:35

285 Views

Suppose, we are given a grid of dimensions h * w. We have to color the border cells of the grid (i.e. the outermost cells of the grid) with a special color. We have to find out how many border cells we have to color.Problem CategoryVarious problems in programming can ... Read More

C++ Program to find number of working components

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 09:04:23

150 Views

Suppose, there is an electronic control board that implies the status of all the components in a system. Each component status is depicted using two LEDs; if any one of them is lit then that component is working. In the board, there are n rows of LED lights, and m ... Read More

C++ Program to print unique integer pairs

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 08:57:46

237 Views

Suppose, we are given two arrays a and b that each contain n integer numbers. From the arrays, we have to create integer pairs where one number is from array a and another one is from array b, and the addition of the numbers is always unique. We print all ... Read More

C++ Program to check if a string has been seen before

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 08:50:15

112 Views

Suppose, we have n number of strings given to us in an array 'stringArr'. We iterate through the string elements one by one and find out if a string has appeared before in the array. If such occurs, we print 'Seen Before!' or otherwise, we print 'Didn't see before!'Problem CategoryTo ... Read More

C++ Program to find an array satisfying an condition

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 08:46:43

477 Views

Suppose, we are given an array of n integers 'x'. We have to find out another array of integers 'y', so that x[1].y[1] + x[2].y[2] +...+ x[n].y[n] = 0. We print the contents of array y.Problem CategoryVarious problems in programming can be solved through different techniques. To solve a problem, ... Read More

C++ code to find score of winning square on a square board

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Mar-2022 14:29:07

187 Views

Suppose we have a square board of order n x n. Amal and Bimal are playing a game. During the game they write numbers on the board's squares by some unknown rules. Currently the board is showing elements after ending the game. To understand who has won, we need to ... Read More

Advertisements