Company: Trade desk_6aug
Difficulty: medium
Draw Figures on Grid Paper Problem Description You have a sheet of n x m grid paper and you'd like to draw a cool design on it. You've decided on a block motif similar to tetris pieces. Specifically, your picture will include the following five types of figures: The array figures contains a list of letters representing the types of figures you'd like to include in your design. Your task is to create a matrix of integers representing the grid paper, and draw the figures on it according to the following rules: Start with a matrix of all 0 s, and use the 1 -based index of each figure to represent it on the grid. For example, if figures[0] = 'E' then the shape added to the grid will look like this: [[0, 1, 0], [1, 1, 1]] Place the figures on the grid in the order they appear in figures . The figures must not overlap any other figures that have already been placed, and they may not be rotated. Of all the available locations, choose the one with the lowest row index. If there are multiple po