Given two arrays of integers a and b, return a new array of pairs (as 2-element arrays) where each pair contains one element from each input array at the same index.
If the arrays have different lengths, stop at the shorter one. Only pair up elements at indices that exist in both arrays.
a = [1, 2, 3], b = [4, 5, 6][[1, 4], [2, 5], [3, 6]]a = [1, 2], b = [3, 4, 5][[1, 3], [2, 4]]a = [10], b = [20][[10, 20]]0 <= a.length, b.length <= 10^4-10^9 <= a[i], b[i] <= 10^9Run your code to see results
Use Cmd+Enter to run