Minimum Absolute Sum Difference
You are given two positive integer arrays nums1 and nums2, both of length n.
Choose an index i (0 <= i < n) and replace nums1[i] with nums2[i] to minimize the sum of the absolute differences between nums1 and nums2. Return the minimum sum of absolute differences.
The absolute difference between two arrays is defined as the sum of |nums1[i] - nums2[i]| for each i (0-indexed).
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)