Find Joining Year from Course Year Lists in C++

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

219 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 which the year of student's university entrance differs by no more than x years from the year of university entrance of this student. The value of x is not given, but it can be determined from the available data. A is a list of groups which the student Amal joined. ... Read More

Find Length of Country Code from Phone Numbers in C++

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

604 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. He assumed that the phone code of the city is the longest common prefix of all phone numbers of his friends. We have to find the length of the city phone code.Problem CategoryTo solve this problem, we need to manipulate strings. Strings in a programming language are a stream of ... Read More

Find Cell Where Next Robbery is Going to Happen in C++

Arnab Chakraborty
Updated on 07-Apr-2022 10:58:18

184 Views

Suppose we have a 2D matrix of characters of size n x m. Where '*' and '.' two types of characters are present. Only three '*'s are there, representing there are 3 robberies, and all other places are marked as '.'. A detective got an information that the fourth robbery will be committed in such cell, that all four robbed cells will form the vertices of some rectangle, parallel to the sides of the map. We have to find the cell.Problem CategoryAn array in the data structure is a finite collection of elements of a specific type. Arrays are used ... Read More

C++ Program to Find Rounded Numbers to Save Kingdom

Arnab Chakraborty
Updated on 07-Apr-2022 10:52:30

199 Views

Suppose we have a string S where a decimal real number is given. There is a king called Amal, and his son Bimal is in a kingdom. There are other citizens also. They lived happily until great trouble came into the Kingdom. The monsters settled there. Most damage those strange monsters inflicted upon the kingdom was that they loved high precision numbers. As a result, the Kingdom healers had already had three appointments with the merchants who sell, exactly 0.273549107 potion barrels. To deal with the problem somehow, the King Amal issued an order obliging rounding up all numbers to ... Read More

C++ Program to Find Missed Episodes

Arnab Chakraborty
Updated on 07-Apr-2022 10:48:05

201 Views

Suppose we have an array A with n elements. There are n episodes of a TV series. They are numbered from 1 to n. We have watched episodes written in array A, but missed one. We have to find which episode we have missed.Problem CategoryVarious problems in programming can be solved through different techniques. To solve a problem, we have to devise an algorithm first and to do that we have to study the particular problem in detail. A recursive approach can be used if there is a recurring appearance of the same problem over and over again; alternatively, we ... Read More

Find Ways to Get A and B Numbers of Chores by Brothers in C++

Arnab Chakraborty
Updated on 07-Apr-2022 10:45:25

269 Views

Suppose we have an array A with n elements and two values a and b. Amal and Bimal are two brothers. Their parents left them home alone and commissioned them to do n chores. Each chore has its complexity. The complexity of the i-th chore equals A[i]. Amal is older, he wants to take the chores with complexity larger than some value x (A[i] > x) to leave to Bimal the chores with complexity less than or equal to x (A[i] ≤ x). Amal will do exactly a number of chores and Bimal will do exactly b number of chores ... Read More

Check If Given Password Is Strong in C++

Arnab Chakraborty
Updated on 07-Apr-2022 10:41:27

1K+ Views

Suppose we have a string S. S is a password. If a password is complex, if it meets all of the following conditions −Password length is at least 5 characters;Password contains at least one uppercase letter;Password contains at least one lowercase letter;Password contains at least one digit.We have to check the quality of the password S.Problem CategoryTo solve this problem, we need to manipulate strings. Strings in a programming language are a stream of characters that are stored in a particular array-like data type. Several languages specify strings as a specific data type (eg. Java, C++, Python); and several other ... Read More

Find Number of Calling Person Pairs in C++

Arnab Chakraborty
Updated on 07-Apr-2022 10:36:59

237 Views

Suppose we have an array A with n elements. A[i] determines the ith id. A[i] is the number of SKP call session. If A[i] is 0, it indicates the person is not using SKP calling system. We have to analyze these data and find out the number of pairs of calling person that are talking. If this is not possible, return -1.Problem CategoryThis problem falls under sorting problems. Sorting is a very common problem while we are talking about different problem-solving algorithms in computer science. As the name suggests, sorting indicates arranging a set of data into some fashion. We ... Read More

Find Tram Lines in Different Trips using C++

Arnab Chakraborty
Updated on 07-Apr-2022 10:31:03

311 Views

Suppose we have a nested list with n sub-lists L. There are several stops on a tram track. Among them only n stops we have seen. L[i] contains another list and the size of L[i] list determines the number of tram lines on that stop. The values of L[i] list is line numbers, and they can be in arbitrary order. We have to find what are the possible lines of the tram we were in?Problem CategoryVarious problems in programming can be solved through different techniques. To solve a problem, we have to devise an algorithm first and to do that ... Read More

C++ Program to Determine Lottery Win

Arnab Chakraborty
Updated on 07-Apr-2022 10:23:07

1K+ Views

Suppose, there is a jackpot lottery going on where there are 100 tickets, each ticket numbered within a number from 1 to 100. Now, the lottery company has decided only the player with ticket number 20 will win the jackpot prize, and ticket holders of number 11 to 21 will win a consolation prize each. So, we have to design the software for that. Given the ticket number, we have to print any one of these three messages, "Sorry, you have lost.", "You have won the jackpot!!!", and "You have won the consolation prize." The ticket number is supplied by ... Read More

Advertisements