Arnab Chakraborty has Published 4452 Articles

C++ code to find answers by vowel checking

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:46:41

142 Views

Suppose we have a string S. Amal and Bimal are playing a game. The rules of the game are like: Those who play for the first time, that is Amal is the detective, he should investigate a "crime" and find out the cause. He can ask any questions whose answers ... Read More

C++ code to find center of inner box

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:42:12

291 Views

Suppose we have a matrix of size n x m. Cells are either 'W' as white or 'B' as black. Some square inside the table with odd length was painted black. We have to find the center of this square.So, if the input is likeWWBBBWWWBBBWWWBBBWWWWWWWWWWWWWthen the output will be (3, ... Read More

C++ code to find greater number whose factor is k

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:37:21

128 Views

Suppose we have two numbers n and k. We have to find smallest integer x which is greater than n and divisible by k.So, if the input is like n = 5; k = 3, then the output will be 6.StepsTo solve this, we will follow these steps −return n ... Read More

C++ code to check pile count is valid from second day

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:35:35

117 Views

Suppose we have two arrays X and Y of same size. There are stone piles with X[i] number of stones on ith index on the first day and on the second day ith index has Y[i] number of stones. On the first day many members have come. Either they do ... Read More

C++ code to find minimum k to get more votes from students

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:33:28

166 Views

Suppose we have an array A with n elements. There are n students in a school and each of them has exactly k votes and all votes should be used. There are two parties. The A[i] represents ith student has given A[i] amount of votes to first party and this ... Read More

C++ code to check triangular number

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:31:34

882 Views

Suppose we have a number n. We have to check whether the number is triangular number or not. As we know, if n dots (or balls) can be arranged in layers to form a equilateral triangle then n is a triangular number.So, if the input is like n = 10, ... Read More

C++ code to find minimal tiredness after meeting

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:29:38

91 Views

Suppose we have two numbers a and b. Two friends are at position x = a and x = b on OX axis. Each of the friends can move by one along the line in any direction unlimited number of times. By moving, the tiredness of a friend changes according ... Read More

C++ code to find corrected text after double vowel removal

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:27:52

129 Views

Suppose we have a string S with n character. On a text editor, there is a strange rule. The word corrector of this text editor works in such a way that as long as there are two consecutive vowels in the word, it deletes the first vowel in a word. ... Read More

C++ code to count steps to reach final position by robot

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:24:46

284 Views

Suppose we have two coordinates (x1, y1) and (x2, y2). A robot is at the point (x1, y1) and wants to go to the point (x2, y2). In a single step, the robot can move towards one cell to its 8 adjacent coordinates. We have to find minimal number of ... Read More

C++ code to count numbers after division elements greater than half of array size

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Mar-2022 11:20:32

106 Views

Suppose we have an array A with n elements. We have to find some non-zero integer d, such that such that, after each number in the array is divided by d, the number of positive values that are presented in the array is greater than or equal to the half ... Read More

Advertisements