Arnab Chakraborty has Published 4293 Articles

C++ Program to find matrix with marked asterisks region

Arnab Chakraborty

Arnab Chakraborty

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

189 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

200 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

155 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

136 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

356 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

275 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

194 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

366 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

C++ Program to find opponent in a circular standing of persons

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 07:54:41

169 Views

Suppose we have three numbers a, b and c. There are k numbers of students (k is even) standing on a circle, they are numbered from 1 to k in clockwise order. We do not know the value of k. Each person is watching through the center of the circle ... Read More

C++ Program to get length of longest subsequence in n times copied sequence

Arnab Chakraborty

Arnab Chakraborty

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

212 Views

Suppose we have an array A with n elements. We can make another array consisting of n copies of the old array, added elements back-to-back. We have to find the the length of the new array's longest increasing subsequence? We know that a sequence p is a subsequence of an ... Read More

Advertisements