The popularity of a combination is the number of frosh selecting exactly the same combination of courses. A combination of courses is considered most popular if no other combination has higher popularity. Output a single line giving the total number of students taking some combination of courses that is most popular.

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter4: Processor Technology And Architecture
Section: Chapter Questions
Problem 9VE
icon
Related questions
Question

Hi, could I ask how I can solve this problem in Java using hashtables? 

Input

The input begins with an integer 1 ≤ ? ≤ 10000, the number of frosh. For each frosh, a line follows containing the course numbers of five distinct courses selected by the frosh. Each course number is an integer between 100 and 499.

Output

The popularity of a combination is the number of frosh selecting exactly the same combination of courses. A combination of courses is considered most popular if no other combination has higher popularity. Output a single line giving the total number of students taking some combination of courses that is most popular.

Sample Input 1
Sample Output i
100 101 102 103 488
100 200 300 101 102
103 102 101 488 100
Sample Input 2
Sample Output 2
3
3
200 202 204 206 208
123 234 345 456 321
100 200 300 400 444
Transcribed Image Text:Sample Input 1 Sample Output i 100 101 102 103 488 100 200 300 101 102 103 102 101 488 100 Sample Input 2 Sample Output 2 3 3 200 202 204 206 208 123 234 345 456 321 100 200 300 400 444
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning