Your question is Nested Loop for 2D Array. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Samsung Semiconductor represents a wafer inspection area as a rectangular two-dimensional grid. Given the number of rows and cols, return a matrix filled with consecutive integers starting at 0, ordered from left to right and then top to bottom.
Implement the function using a single Python return statement with a nested list comprehension. The inner comprehension must create each row, and the outer comprehension must create the matrix.
rows and cols.rows lists, where each inner list contains cols integers.[r][c] must be r * cols + c.rows rows.cols values.def build_inspection_grid(rows, cols):