When given 4 numbers, how do i find which 3 numbers out of the 4 will give the greatest sum. So if given 3 2 5 5, i want java to sum 3 5 5 for a total of 13
I have been searching for about 20 minutes and all i find is how the find the highest number of the 4 numbers. I know i absolutely can just write 16 lines of code comparing the 16 different combinations but i was hoping someone could point me in a faster direction.