I would like to create a program capable of generating formations for soccer based on the votes obtained by the players in the previous game.
Then, based on the votes obtained, the program “sorts” the players in order to create balanced teams
Example
7 7 4 6 7 4 5 5 7 8
Team1: 6 4 7 7 7
Team2: 5 5 6 8 7
How can i do this?