Arnab Chakraborty has Published 4452 Articles

C++ Program to find room status after checking guest appearance record

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Mar-2022 07:06:54

245 Views

Suppose we have a string S with 'L', 'R' and digits from 0 to 9. Consider there is a hotel with 10 rooms they are numbered from 0 to 9, from left to right. The hotel has two entrances-one from the left side, and another from the right side. When ... Read More

C++ Program to find winner name of stick crossing game

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Mar-2022 06:46:42

173 Views

Suppose we have two numbers n and k. Amal and Bimal are playing a game. The rules are simple. Amal draws n sticks in a row. After that the players take turns crossing out exactly k sticks from left or right in each turn. Amal starts the game. If there ... Read More

C++ Program to count number of operations needed to place elements whose index is smaller than value

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Mar-2022 06:41:57

177 Views

Suppose we have an array A with n elements. We can perform these operations any number of times −Select any positive integer kSelect any position in the sequence and insert k into that positionSo, the sequence is changed, we proceed with this sequence in the next operation.We have to find ... Read More

C++ program to find length of non empty substring whose sum is even

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Mar-2022 06:38:37

89 Views

Suppose we have an array A with n elements. We have to find the length of a non-empty subset of its elements such that their sum is even or return -1 when there is no such subset.So, if the input is like A = [1, 3, 7], then the output ... Read More

C++ program to find string with palindrome substring whose length is at most k

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Mar-2022 06:29:01

204 Views

Suppose we have two numbers n and k. Let we are trying to generate a string S with only three types of characters 'a', 'b' and 'c'. The maximum length of a substring of the string S that is a palindrome which does not exceeds k.So, if the input is ... Read More

C++ Program to count number of characters to be removed to get good string

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Mar-2022 06:23:53

146 Views

Suppose we have a string S. S contains two types of characters in S, the 'x' and 'a'. We have to count what will be the longest string remaining after removal of few characters in S so that it becomes good string. A string is good if it has strictly ... Read More

C++ program to count minimum how many minutes after there will be no new angry students

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 11:37:58

135 Views

Suppose we have a string S of length n, with only two types of characters, 'A' or 'P'. There are n students in a row, the ith student is angry if S[i] = 'A', if it is 'P' it says S[i] is patient. An angry student at index i will ... Read More

C++ program to count number of minimum coins needed to get sum k

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 11:24:02

155 Views

Suppose we have two numbers n and k. We have unlimited number of coins worth values 1 to n. We want to take some values whose sum is k. We can select multiple same valued coins to get total sum k. We have to count the minimum number of coins ... Read More

C++ program to choose some numbers for which there will be no subset whose sum is k

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 11:22:14

157 Views

Suppose we have two numbers n and k. We have to choose the maximum number of distinct elements from 1 to n, so that no subset whose sum is equal to k. If we can find then return the chosen numbers.So, if the input is like n = 5; k ... Read More

C++ program to find winner of typing game after delay timing

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 11:20:12

243 Views

Suppose we have five numbers s, v1, v2, t1 and t2. Amal and Bimal are playing a typing game, they are playing their game online. In this game they will type a string whose length is s. Amal types one character in v1 milliseconds and Bimal types one character in ... Read More

Advertisements