Recently a friend of mine proposed to solve a simple problem and I'm struggle to find the best algorithm to solve it.
There's a list of athletes, every athlete has a name, a weight and can have multiple roles, at least 1 maximum 3 ( Internal, Median and External ). A team is composed by 6 athletes ( 2 internals, 2 medians and 2 externals ). There is also a weight limit which is at 540kg.
What is the best algorithm to find all possible combination for this problem?
Right now I find all combination iterating through the list of athletes, all of its roles and removing all combinations that overpass a limit.
Do you have any better algorithm to solve this problem? What is the best method to approach a problem like this in order to solve it?
Thank you