MVCC snapshot isolation visibility

Write codeHard30 minOracle and Snowflake style

Your task

Implement an MVCC visibility check under snapshot isolation. versions is a list of [key, value, committed_at], committed row versions, each stamped with the commit timestamp. A reading transaction has a snapshot timestamp 'snap': it sees, for each key, the version with the GREATEST committed_at that is strictly less than or equal to snap. queries is a list of keys to read. Return a list of [key, value] for each query in order, using the visible version; if no version is visible for a key, use the value 'MISSING'. Assume committed_at values for a key are distinct.

Examples

mvcc_read(versions: list[list], snap: int, queries: list[str]) -> list[list]
Example 1
Inputmvcc_read([["x", "v1", 10], ["x", "v2", 20]], 15, ["x"])
Output[["x", "v1"]]