Company: Nasdaq_18oct
Difficulty: medium
Wooden Block Puzzle Problem Description Imagine running a small woodworking shop, building wooden puzzle toys meant to delight children. A series of small sliding puzzles is planned, and the goal is to write code that solves them automatically. Each puzzle takes place on a grid holding wooden blocks of assorted shapes. These blocks need to leave the grid one at a time, without ever colliding with each other. The task is to work out the order in which they should exit. Each block carries a label from 0 to 9. Naming a block's number sends it sliding rightward until it exits the grid entirely. When more than one block is free to exit at once, any of them may be chosen to go first. Implement the function solve(width, height, nb_blocks, grid) . It runs once per round of the puzzle and must return the label of the block to move next. Input Data of the Function width : width of the puzzle, in number of cells. height : height of the puzzle, in number of cells. nb_blocks : number of blocks init