Implement checkout(rows, requests) — a reservation system over rows (a list of dicts {'sku', 'stock', 'version'}):
- each request is (sku, conflict_on_attempt_set) meaning: decrement that SKU's stock by 1, where the given 1-based attempt numbers lose a race (another writer bumped the version first)
- apply optimistic concurrency per request: read version, mutate, conflict → retry with the bumped row, up to **3 attempts**; after that the request fails
- a request fails immediately if the stock is 0 at the moment of a winning write: return its sku in out_of_stock instead
- return {'rows': rows_after_all_requests, 'applied': [skus in request order], 'out_of_stock': [skus that failed]}
The invariant: two requests racing for the last unit — exactly one wins, the loser reports out_of_stock (or retries and then reports honestly).
Difficulty: advanced