Arnab Chakraborty has Published 4452 Articles

C++ Program to find maximum score of bit removal game

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 08:39:41

97 Views

Suppose we have a binary string S with n bits. Amal and Bimal are playing a game. Amal moves first, then Bimal, and they move alternatively. During their move, the player can select any number (not less than one) of consecutive equal characters in S and remove them. After the ... Read More

C++ Program to check string is strictly alphabetical or not

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 08:33:51

250 Views

Suppose we have a string S with n letters in lowercase. A string is strictly alphabetical string, if it follows the following rule −Write an empty string to TThen perform the next step n times;At the i-th step take i-th lowercase letter of the Latin alphabet and insert it either ... Read More

C++ Program to find matrix with marked asterisks region

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 08:28:16

129 Views

Suppose we have a n x n grid of characters with dots (.) and asterisks (*). All cells are marked as dot except two cells. We have to mark two more cells so that they are the corners of a rectangle with sides parallel to the coordinate axes. If there ... Read More

C++ Program to check string can be reduced to 2022 or not

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 08:18:57

129 Views

Suppose we have a numeric string S with n digits. We perform the following operation with the string S, no more than once. We select two numbers i and j (1 ≤ i ≤ j ≤ n) and removes characters from S string from positions i to j. We have ... Read More

C++ Program to check k rupees are enough to reach final cell or not

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 08:15:00

86 Views

Suppose we have three numbers n, m and k. There is a n x m grid. we are currently at cell (0, 0) top left corner and we want to reach cell (n - 1, m - 1). We can move to the neighboring cells to the right or down. ... Read More

C++ Program to get largest sum we can make from 256 and 32 from digits

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 08:12:32

87 Views

Suppose we have four numbers a, b, c and d. In a box there are some numeri digits. There are 'a' number of digits 2, 'b' number of digits 3, 'c' number of digits 5 and 'd' number of digits 6. We want to compose numbers 32 and 256 from ... Read More

C++ Program to find winner of unique bidding game

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 08:09:40

228 Views

Suppose we have an array A with n elements. There are n participants, the i-th participant chose the number A[i]. The winner of the bidding game is such a participant that the number he chose is unique and is minimal. We have to find the index of the participant who ... Read More

C++ Program to find minimum moves to get all books contiguous

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 08:05:48

183 Views

Suppose we have an array A with n elements. Consider there is a bookshelf and this =can fit n books. The i-th position of bookshelf is A[i], is 1 if there is a book on this position and 0 otherwise. There will be at least one book in the bookshelf. ... Read More

C++ Program to count operations to make filename valid

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 08:02:13

113 Views

Suppose we have a string S with n letters. Amal is trying to send a file in the social network, but there is an unexpected problem. If the name of the file contains three or more "x" consecutively, the system considers that the file content does not correspond to the ... Read More

C++ Program to find minimum k for candy distribution

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 07:58:31

256 Views

Suppose we have an array A with n elements. Amal has n friends, the i-th of his friends has A[i] number of candies. Amal's friends do not like when they have different numbers of candies. So Amal performs the following set of actions exactly once −Amal chooses k (0 ≤ ... Read More

Advertisements