• + 15 comments
    1. Sort the array
    2. Sum everything BUT the last item (now you have the mini sum)
    3. Sum everything BUT the first item (now you have the max sum)

    3 lines of code!