Answer the question
In order to leave comments, you need to log in
How to solve the problem about leaders and outsiders?
Take a random sport.
In the database, we have plate No. 1 with the following structure:
Team Win Loss
Team_1 8 18
Team_2 2 9
Team_3 10 2
Team_4 5 8
Team_N 9 10
And plate No. 2, the structure is as follows:
Home match Away match Date
Team_1 Team_2 12/19/2005
Team_3 Team_4 20.12 .2005
Team_N Team_M 12/30/2005
Commands are naturally repeated and can be both in the first column and in the second.
And now the problem. You need to find on which day the strongest team plays with the weakest.
In this setting, everything seems to just find the strongest and weakest and check 2 options:
Weak_Team - Strong_Team
Strong_Team - Weak_Team
But what if we need to find, for example, the 10 strongest and 10 weakest teams and find them in the schedule?
Is there an optimal algorithm? Or do you need to brute force everything against everyone?
Answer the question
In order to leave comments, you need to log in
If anyone is interested in how I solved.
I took the first table and attached 2 columns to it in which I wrote down whether the team is a loser or a favorite.
Home match Away match Date Winner Loser
If the Winner and Loser columns were both equal, then a match has been found.
10 strongest ,1 strongest team and the strongest 9 of those who will remain after the first run of the algorithm circle (excluding the one that has already become the strongest) or not?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question