Given two lists a and b and a value fill, return a list of two-element lists [a[i], b[i]], one for every index i from 0 to max(len(a), len(b)) - 1 (so as many pairs as the longer list has elements). Where the shorter list has no element at index i, use fill in its place.
Examples
Input: a = [1, 2, 3], b = ['a', 'b'], fill = None
Output: [[1, 'a'], [2, 'b'], [3, None]]
Input: a = [], b = [7, 8], fill = 0
Output: [[0, 7], [0, 8]]
Constraints
0 <= len(a), len(b) <= 10**5- Return a new list of two-element lists.
- Target: O(max(len(a), len(b))) time.
Goals
- Pair elements by index across two lists
- Fill missing positions of the shorter list with a given value
- Produce exactly max(len(a), len(b)) pairs