Object-Oriented Programming · Bloomberg · Medium
Build a two-dimensional sparse matrix that can be modified after creation and that offers three operations: get(row, col): return the value at the given cell; any cell that is not stored reads as 0. set(row, col, value): overwrite the value at the given cell. If the new value is zero, the cell must no longer be kept in storage. matmul(other): return a new sparse matrix equal to the product of this matrix and other. When A has shape $$R \times K$$ and B has shape $$K \times…