Company: DevRev
Difficulty: medium
Codewriting Problem Description You are given a rectangular board divided into a uniform grid (square cells). Some cells of the board are occupied with blocks, and others are empty. You are trying to add more and more blocks to the board, and your task is to fill the first column with them. You can add a block to the field in the following way: first, you choose the row index, then you throw the new block into the chosen row from the left. The block appears in the leftmost cell of the row and starts moving to the right, until it reaches another block or the end of the row. When that happens, the block starts falling down until it reaches another block or the last row. For example, if the board looks like this .#. ..#. ...# blocks are denoted by '#' and empty cells are denoted by '.'. and you throw a block into the first or the second row from the top, it will end up like this: ..#. ..#. ..##. Your task is to calculate the minimum and the maximum number of moves required to fill the fir