Algorithm · Dropbox · Medium
Problem Simulate dropping a Tetris-like block into an environment. You are given an array that describes the block, an array that describes the environment, and an integer specifying the block's lateral offset. Determine how many downward steps the block makes before an obstruction stops it. Use the following function shape: As a follow-up, produce the final environment array after placing the block in its stopped position. Example The block covers the environment columns…
Checking your access…