# Solve this Problem

• May 29th, 2010, 05:15 AM
veersharma
Solve this Problem
Hi All,

Can someone find a solution / approach to the problem below. I am looking for best approach (time / space) and request an open discussion on the same from members....

Question:
Given int n, the total number of players and their skill-point. Distribute the players on 2 evenly balanced teams.
• May 30th, 2010, 06:19 AM
nuzzle
Re: Solve this Problem
Quote:

Originally Posted by veersharma
Given int n, the total number of players and their skill-point. Distribute the players on 2 evenly balanced teams.

So there are N players and they should be divided into two teams.

The question is should each team have the same number of players? In that case there's a common and very simple distribution strategy. The two best players become captains for each one team and then they take turns to pick a player for their team until all players are chosen. It's understood that the best remaining player (the one with the highest skill-point) is always selected next.

I don't know if this strategy is optimal but I do know it's considered fair by every kid above the age of seven or so. :)