Arnab Chakraborty has Published 4293 Articles

C++ Program to count ordinary numbers in range 1 to n

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 07:47:40

767 Views

Suppose we have a number n. A number is a positive integer n, and that said to be an ordinary number if in the decimal notation all its digits are the same. We have to count the number of ordinary numbers in range 1 to n.Problem CategoryVarious problems in programming ... Read More

C++ Program to find permutation from merged permutations

Arnab Chakraborty

Arnab Chakraborty

Updated on 08-Apr-2022 07:44:17

266 Views

Suppose we have an array A with 2n number of elements. We know a permutation of first n natural numbers is a set of numbers where 1 to n are stored and they are ordered in an arbitrary order. in the array A, there are two permutations of size n ... Read More

C++ Program to check given candies can be split with equal weights or not

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 11:24:17

301 Views

Suppose we have an array A with n elements. Amal and Bimal received n candies from their parents. Each candy weighs either 1 gram or 2 grams. They want to divide all candies among themselves fairly so that their total candies weight is same. We have to check whether we ... Read More

C++ Program to find minimum difference between strongest and weakest

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 11:21:24

187 Views

Suppose we have an array A with n elements. There are n athletes in a game. They are numbered from 1 to n and arranged in left to right order. The strength of each athlete i is A[i]. We want to split all athletes into two teams. Each team must ... Read More

C++ Program to count operations to make all gifts counts same

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 11:17:37

1K+ Views

Suppose we have two arrays A and B of size n each. There are n gifts and we want to give them to some children. The ith gift has A[i] candies and B[i] oranges. During one move, we can choose some gift and do one of the following operations −Take ... Read More

C++ Program to find winner and final price in a second price auction event

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 11:14:09

323 Views

Suppose we have an array A with n elements. There is a special type of an auction, which is called the second-price auction. In a regular auction, n bidders place a bid which is price a bidder ready to pay. The auction ends, when each bidder secretly informs the organizer ... Read More

C++ Program to find array of candy distribution to m friends

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 11:11:37

318 Views

Suppose we have two numbers n and m. Amal has n candies and m friends. He wants to make a present with candies to each friend. Amal is planning to present all candies and he wants to do this in the most equal manner. He wants to choose such A[i], ... Read More

C++ program to distribution of apples for two mice

Arnab Chakraborty

Arnab Chakraborty

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

433 Views

Suppose we have a number n and two arrays A and B of different sizes. There are two mice: m1 and m2. We put n apples in front of them. We know which apples m1 likes. Similarly, we also know which apples m2 likes. We do not want any conflict ... Read More

C++ Program to find joining year from the course year lists

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 11:04:58

171 Views

Suppose we have an array A with n elements. In a university for each course there is the special group whose name equals the year of university entrance of corresponding course of students at the university. Each of students joins the group of his course and joins all groups for ... Read More

C++ Program to find length of country code from phone numbers

Arnab Chakraborty

Arnab Chakraborty

Updated on 07-Apr-2022 11:01:29

544 Views

Suppose we have a list of strings S with n numeric strings. Amal has n friends in a city. Amal knows phone numbers of all his friends: they are stored in S. All strings in S are of same length. Once Amal needed to figure out the city phone code. ... Read More

Advertisements