Js Array Partition problem

let arrs=[102,233,45,350,130,220,195,240]

I want arrs to split into two groups, but I want the sum of the two groups to be as close as possible. The smaller the difference, the better. My own idea is to re-sort, from small to large, and then judge the subscript to divide into two groups, odd group, even group, or the first two minimum values and the last two maximum values as a group, and the middle four as a group.
do you have a more accurate way to get the minimum difference?

Mar.22,2021

divide all the elements in the array by two
use this value to solve a < del > knapsack problem < / del > subset and problem (Subset sum problem)


"stupid" method

  

there is no solution to this problem, so please answer your needs again.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e43f41-44a84.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e43f41-44a84.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?