Sparse Matrix Multiplication Medium Python