OpenGenus / cosmos

World's largest Contributor driven code dataset | Used in Quark Search Engine, @OpenGenus IQ, OpenGenus Visual Project
http://internship.opengenus.org
GNU General Public License v3.0
13.58k stars 3.69k forks source link

Codechef VOTERS Solution in C #4946

Open ritish099 opened 4 years ago

ritish099 commented 4 years ago

This is a(n):

Details:

As you might remember, the collector of Siruseri had ordered a complete revision of the Voters List. He knew that constructing the list of voters is a difficult task, prone to errors. Some voters may have been away on vacation, others may have moved during the enrollment and so on.

To be as accurate as possible, he entrusted the task to three different officials. Each of them was to independently record the list of voters and send it to the collector. In Siruseri, every one has a ID number and the list would only list the ID numbers of the voters and not their names. The officials were expected to arrange the ID numbers in ascending order in their lists.

On receiving the lists, the Collector realised that there were discrepancies - the three lists were not identical. He decided to go with the majority. That is, he decided to construct the final list including only those ID numbers that appeared in at least 2 out of the 3 lists. For example if the three lists were

23 30 42 57 90 21 23 35 57 90 92 21 23 30 57 90 then the final list compiled by the collector would be:

21 23 30 57 90 The ID numbers 35, 42 and 92 which appeared in only one list each do not figure in the final list.

Your task is to help the collector by writing a program that produces the final list from the three given lists.

anjalisoni3655 commented 4 years ago

please assign me this issue @AdiChat

ritish099 commented 4 years ago

@anjalisoni3655 its already done in C. pick any other language for this problem

anjalisoni3655 commented 4 years ago

@AdiChat Please check it out!!