Your task is to complete the implementation of a generic Matrix class. A matrix is a two-dimensional arrangement of elements. You access elements with a row and column index. For example,
Matrix<String> tttBoard = new Matrix<String>(3, 3);
tttBoard.put(0, 0, "x"); if (tttBoard.get(1, 2).equals("o")) . . .
Since we are not allowed to use generic arrays, we use an array list instead. We store the (i, j) element at index i * columns + j. For example, in a 10 x 10 matrix, the (3,4) element is stored at index 3 * 10 + 4 = 34.
Complete the implementations of the get and put method below.