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")) . . .
If the matrix has many rows and columns but few elements, it doesn't make sense to allocate a large two-dimensional array, most of whose entries are null. Instead, we will only store the non-null entries in a map. Keys of the map are integer pairs. A Pair class is provided for you.
Complete the implementations of the get and put method below.