0624. Maximum Distance in Arrays
https://leetcode.com/problems/maximum-distance-in-arrays
Description
You are given m
arrays
, where each array is sorted in ascending order.
You can pick up two integers from two different arrays (each array picks one) and calculate the distance. We define the distance between two integers a
and b
to be their absolute difference |a - b|
.
Return the maximum distance.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
m == arrays.length
2 <= m <= 105
1 <= arrays[i].length <= 500
-104 <= arrays[i][j] <= 104
arrays[i]
is sorted in ascending order.There will be at most
105
integers in all the arrays.
ac
Last updated