Answer the question
In order to leave comments, you need to log in
How to find a combination of any number of elements of the requests subarray, the sum of whose values will be as close as possible to, or equal to, the value of max_sum?
Hello gentlemen.
There is an array like:
[test] => Array
(
[max_sum] => 15
[requests] => Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
[6] => 7
[7] => 8
[8] => 9
[9] => 10
[10] => 3
[11] => 5
[12] => 5
[13] => 1
[14] => 7
[15] => 8
[16] => 5
)
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question