0

Help with PHP arrays

Hello guys. I need to resolve array elements into groups using PHP: myArray = [1, 2, 4, 7, 1, 6, 2, 8]; and each of the group sum should be as equal as possible between themselves. result should be: 8, 2 = 10; 7, 2, 1 = 10; 6, 4, 1 = 11; Any options? Thanks in advance!

15th Aug 2022, 11:10 AM
Marko Polo
Marko Polo - avatar
4 Answers
+ 1
Attempts?
15th Aug 2022, 11:31 AM
A͢J
A͢J - avatar
+ 1
Marius Strumyla Did you understand what I asked? Your attempts?
15th Aug 2022, 11:36 AM
A͢J
A͢J - avatar
0
All options are accepted. Just needs to be done, does not matter how
15th Aug 2022, 11:32 AM
Marko Polo
Marko Polo - avatar
0
I have made none yet. Still googling
15th Aug 2022, 11:41 AM
Marko Polo
Marko Polo - avatar