You’re building a compliance check for a fintech payout system processing tens of millions of transfers per day. Regulators require that payouts to blocked merchant IDs be detected quickly and deterministically. Your service receives (1) a list of blocked merchant IDs updated hourly and (2) a batch of payout merchant IDs for the last minute. You must report which blocked IDs appear in the payout batch, including how many times each appears.
Implement a function:
blocked: list[int] — merchant IDs that must not receive payoutspayouts: list[int] — merchant IDs present in a payout batch (may contain duplicates)[(merchant_id, count), ...] for every merchant_id in blocked that appears in payouts, where count is the number of occurrences in payouts.merchant_id ascending.payouts, it must not be included.blocked should be treated as a single ID (i.e., output each ID at most once).0 <= blocked.length, payouts.length <= 2 * 10^5-10^9 <= merchant_id <= 10^9O(len(blocked) * len(payouts)).