Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMichal Slotwinski
13,811 PointsIs this legit ?
Well I would never figured it out the way instructor did but i have simply swapped x with y.
namespace SoccerStats
{
public class PlayerComparer : IComparer<Player>
{
public int Compare(Player x, Player y)
{
return y.PointsPerGame.CompareTo(x.PointsPerGame);
}
}
}
is this an ok solution ?
1 Answer
lonedo
24,500 PointsYes, this is a valid solution, The beauty of programming is that there are multiple ways to solve a problem.