0
Haskell, 65 bytes f(u:v)=maximum[e+f(take i<>drop(i+1)<$>v)|(i,e)<-zip[0..]u] f _=0 Try it online! Explanation & Ungolfed The function take i<>drop(i+1) takes a list and removes the element at position i. The function f gets each possible element e at position i, removes the elements at p...