SWPDGT - Editorial

@taran_1407 can you please explain the logic for the bonus part of this question… i.e.,

Can you solve it without explicitly doing swaps and then comparing?

I m not able to find solution for this. Please guide…

thank you so much for your testcase.

can anyone explain the setter solution
mx=max(mx,a210+b1+b210+a1);
if(b2) mx=max(mx,a210+b2+a110+b1);
if(a2) mx=max(mx,b110+a1+b210+a2);
if(a2 && b2) mx=max(mx,b210+a1+a210+b1);
i am not getting the logic behind this code