(This question is a variation of the LeetCode question 311. Sparse Matrix Multiplication. If you haven't completed that question yet, it is recommended to solve it first.)
A sparse matrix is a two-dimensional array in which most elements are zero. Storing such matrices in their original form can waste a significant amount of space. To address this, design a class that efficiently stores sparse matrices while supporting key operations such as addition and multiplication using minimum space.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected