How to solve this with out brue force approach?
There are 2 arrays we have to find out the sum that is identify the indexes whose sum is nearly equal to target. Please note we cannot sort the arrays. How to solve with out following brute force approach?

Array1-[8,10,12],Array2-[8,11,10] o/p: [[2,1],[1,2]] target-20
Array1-[7,1,14],Array2-[6,5,10] o/p: [[0,1] target-13
Comments (1)