Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
If you draw a graph with the value on one axis and the absolute difference between the target and the array sum, what will you get?
That graph is uni-modal.
Use ternary search on that graph to find the best value.