My approch for this question is like this:

first i rearrange all the bats in decreasing order

now i select the baat which is the heaviest and put it into one variable among remaining bats i find the sum of two bats which are equal or just less than the first baat and put it into second variable…then i again select one among remaining bats and add it with first variable…and then again select two baats which when added with second variable will be just less or equal to first variable…and this goes on…if just one element is left i add it with the min of two variables

so in the end if the no of baats is even i print bigger sum first followed by smaller sum

and if they are odd then the sum with lower no of bats is written first and then the other

is this approach correct??

my solution id is