• + 3 comments

    consider sol={1,4,4,1,1,6,1) , according to your logic maxi=6+1=7, but that's not true maxi will be 4+4=8