Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Monday, Dec 7.Claim the deal

You are given a Tetris-like background grid background, a falling piece block, and a zero-indexed horizontal starting column offset.

background is a binary occupancy grid, where 0 represents an empty cell and 1 represents an occupied cell. block is a binary shape mask: block[r][c] = 1 means the falling piece occupies the cell at local row r and column c, while block[r][c] = 0 means that position is empty and does not participate in collisions.

Test Cases
Input
Output
Expected