What is a Sparse Matrix?

What is a Sparse Matrix?

Approach: Define a matrix where most elements are zero.

A matrix in which most of the elements are zero. Efficient storage and computation techniques (like Compressed Sparse Row) are used to save space and time.

Follow-up: How would you store it in a Python dictionary?

Key concepts: efficiency, storage, csr format.