Hi NorthGuy,
I'm wondering, how would you approach the problem if it was 'Given an unsorted list of N numbers, what is 5-number group with the largest sum, while having the group members non-neighbored'.
e.g. N = 15, list = {1, 5, 3, 10, 8, 9, 7, 3, 2, 4}
Result: 5, 10, 9, 3, 4
Would you take the largest 9 numbers (i.e. 5 numbers + 4 gaps) and from them consitute the 5-number group?
If it's true, it'd actually take (9*8*7*6*5 / 5! ) options to check for the desired group, right?