Huawei OD machine test - the site with the largest number of people (JAVA, C, C++, GO, Python, JavaScript)

The site with the largest number of test questions for Huawei OD machines, JAVA & Python & C & C++ & GO & JavaScript

topic

The park area provides small trains for one-way traffic. From the smallest station number to the largest station number in the park, the
number of passages is as high as 1~2~3~4~110,000 , and then it is used for employees to shuttle in various office parks.
Through the survey and statistics of Neach , the bus interval of each employee, including the front and rear stations,
please Design a program to calculate which park station the train has the most people at.

enter

The 1inputted line is the number of surveyed employees,
and the beginning of 2the line
is the starting pick-up station and drop-off station of each employee.
Use numbers to replace each park with a space, split such as 3 5means to 3on the bus from the No. 1 park and get off
at the 5No. 1 park

output

The park site number when the number of people is the largest, and return the park site with the smallest number when the maximum number of people is the same

example one

enter

3
1 3
2 4
1 4

output

2

illustrate

1line

Guess you like

Origin blog.csdn.net/jiong9412/article/details/130312014