Implement a sparse matrix class, including efficient addition and multiplication methods.
Represent each matrix as dimensions plus nonzero coordinate entries. Implement to_dict(), add(other), and multiply(other), removing zero-valued results and returning entries sorted by row and column. The grading function constructs two matrices and returns both operation results.
Input matrices are dictionaries with rows, cols, and entries, where each entry is [row, col, value]. Return {"sum": object or null, "product": object or null}. Addition requires equal dimensions; multiplication requires matrix_a.cols == matrix_b.rows.
def sparse_matrix_operations(matrix_a, matrix_b):