Hash index point lookup

Write codeMedium20 minSnowflake and Oracle style

Your task

Build a hash index over a table and answer point lookups. You are given rows as [key, value] pairs (keys are strings, not unique, later rows with the same key shadow earlier ones, last-write-wins) and a list of lookup keys. Build the index once, then for each lookup key return its current value, or the string "MISS" if the key is absent. Return a list of values, one per lookup, in order.

Examples

hash_index_lookup(rows: list[list], lookups: list[str]) -> list[str]
Example 1
Inputhash_index_lookup([["a", "1"], ["b", "2"], ["a", "9"]], ["a", "b", "c"])
Output["9", "2", "__MISS__"]