if we have n lists, we need to select a number from each list, the selected number cannot be selected again, how to make selection to get the largest sum of n selected numbers? e.g.
list1: 4 5 7.
list2: 3 5 7.
list3: 1 5
if we select 7 from list1, the largest number we can select in list 2 is 5(because same number cannot be selected twice), if we select 5 from list2, we can only select 1 from list3, so the sum is 7+5+1=13
it is NOT the best selection. however, if we select 4 from list1, 7 from list2, 5 from list3, the sum is 4+7+5=16
Is there a algorithm to find the best way to make selection in order to get the largest sum? The solution should be perfect.