Solution
1 - If the pack is less than the minimum element in array return
the firts element of the array;
2 - If the pack is more than the minimum element in array, so we
need to divide the pack with the maximum element less the pack;
3 - The algorithm doing the step 2 until the waste of the divide
is less than 0;
4 - Afther step 3, the resuld should be reduce que result just
with element inside the array.
Improvement
*** Get better peformance algoritm -> To do the step 3 inside the step 4 - can you refactore for me, pls?! 🤓 ***
Run Application
$ go run main.go
Test
For run all the unit tests cases in the challenge:
$ go test
Documentation
https://documenter.getpostman.com/view/7723976/TzRXARwF#1cbe209f-be76-4543-b4ce-2cbccd5b9d4f