Scribd's recommendation pipeline receives a sequence of book IDs with prices and a second array containing eligible book IDs. Return every book from the first array that appears in the second array, preserving order. For each matching position i, also return the cheapest price strictly before position i in the first array.
If no price exists before i, return None for that book. Duplicate IDs in the first array should produce duplicate output entries. Membership in the second array is treated as a set, so duplicates there do not change the result.
Implement intersect_with_prior_min(book_ids, eligible_ids, prices). book_ids and prices are arrays of equal length, and eligible_ids is another integer array. Return an array of two-element arrays, where each element is [book_id, prior_min_price].
def intersect_with_prior_min(book_ids, eligible_ids, prices):