Arnab Chakraborty has Published 4452 Articles

C++ program to find n valid bracket sequences

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:28:11

353 Views

Suppose we have a number n. As we know, a bracket sequence is a string containing only characters "(" and ")". A valid bracket sequence is a bracket sequence which can be transformed into a correct arithmetic expression by inserting characters "1" and "+" between the original characters of the ... Read More

C++ program to find fourth side of a quadrilateral

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:24:58

177 Views

Suppose we have three numbers a, b and c. We want to make a closed fence in a shape of arbitrary non-degenerate simple quadrilateral. We already have three sides of length a, b and c. We have to find another side d.So, if the input is like a = 12; ... Read More

C++ program to find range whose sum is same as n

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:22:36

141 Views

Suppose we have a number n. We need to find two integers l and r, such that l < r and l + (l + 1) + ... + (r - 1) + r = n.So, if the input is like n = 25, then the output will be l ... Read More

C++ program to count number of dodecagons we can make of size d

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:22:22

87 Views

Suppose we have a number d. Consider there is an infinite number of square tiles and regular triangular tiles with sides length 1. We have to find in how many ways we can form regular dodecagon (12-sided polygon) with sides d using these tiles. If the answer is too large, ... Read More

C++ program to find circumference of the circular pond with radius R

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:17:43

80 Views

Suppose we have a number R, represents the radius of a pond. We have to find the circumference of this pond.So, if the input is like R = 73, then the output will be 458.67252742410977361942StepsTo solve this, we will follow these steps −res := r * 2 * cos-inverse (-1) ... Read More

C++ program to find string after adding character 'a' string becomes non-palindrome

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:17:30

94 Views

Suppose we have a string S with lowercase English letters. We must insert exactly one character 'a' in S. After inserting that if we can make S not a palindrome then return that string, otherwise return "impossible".So, if the input is like S = "bpapb", then the output will be ... Read More

C++ program to convert kth character to lowercase

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:15:49

147 Views

Suppose we have a string S with N characters. S contains only three types of characters 'A', 'B' or 'C'. We also have another integer K. We have to print S after lowercasing the Kth character in it.So, if the input is like K = 2; S = "AABACC", then ... Read More

C++ program to find minimum possible difference of largest and smallest of crackers

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:13:47

237 Views

Suppose we have two numbers N and K. We want to distribute N crackers to K users. We have to find the minimum possible difference between the largest number of crackers received by a user and smallest number received by a user.So, if the input is like N = 7; ... Read More

C++ program to check the coins forms x amount of rupees or not

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:11:53

112 Views

Suppose we have two numbers K and X. Consider Amal has K, 500 rupee notes. We have to check whether the sums up to X rupees or not.So, if the input is like K = 2; X = 900, then the output will be True, because 2*500 = 1000 and ... Read More

C++ program to count in how many ways we can minimize cable length to connect computers

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Mar-2022 07:02:43

209 Views

Suppose we have two arrays A and B both with N elements. Consider there are N computers and N sockets. The coordinate of ith computer is A[i] and coordinate of ith socket is b[i]. These 2N coordinates are pair-wise distinct. We want to connect each computer with a socket by ... Read More

Advertisements