Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
Group items of an array so the sum of the values in that group is aproximatley equal to the other groups

I have an array that looks like this:

arr = [
{name:"Name",value:0}
{name:"Name",value:2}
{name:"Name",value:5}
{name:"Name",value:3}
]

And I would like to group the items from the array from above into an predefined amount of groups (1,2,3 or more) with the condition that every group value sum must be close as possible to the other group's sum.

Any suggestions or solutions are welcome.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!