Most Different Position
a and b are two arrays of the same length. Return the index i where |a[i] - b[i]| is the largest. If there is a tie, return the smallest such index.
Example 1
a [1,5,9]
b [2,1,8]
returns 1
The gaps are 1, 4 and 1, so index 1.
Constraints
1 <= len(a) = len(b) <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Outlier CountEasy
- Pair DifferencesEasy
- Percent ChangeEasy
- Row RangesEasy
- Rows With a ZeroEasy
- Rows of WidthEasy
- Runner-Up per RowEasy
- Running Total per ColumnEasy