Start out with an empty list of lists. What are the contents of row 2 after these operations?
Instead of using a 2D array, it is possible, though more complicated, to use a 1D array instead. For example, this would be how to convert a 2x2 array to a 1D array with 4 elements:
Given the index of an element of the 1D array, how can you convert it into the indices for the same element in the 2D array? For example, an index of 1 would be come (0,1) in the 2D array.
4 1 9 1 0
i = indices of 1D array
l = side length of the square "made" by the 2D array
x = floor(i,l)
y = mod(i,l)
answer is x,y
Bonus: Go from left to right for the first row then then go to the next row and start listing the numbers from left to right of the second row, and so on. The index of the 1d array will be based on the logical ascending order of the rows and columns of the 2d array.
4, 1 9, 1, 0
x = indices of 1 dimensional array
n = side length of square 2 dimensional array