Search
⌘K

Leetcode 311. Sparse Matrix Multiplication

Multiply two matrices while exploiting sparsity to avoid needless zero multiplications: compute the product of two potentially large, sparse matrices by iterating only over non-zero entries (e.g., using compressed or hash-based representations) to accumulate results efficiently. The challenge is designing a traversal and accumulation strategy that minimizes work compared to the dense O(n^3) approach.

Asked at:

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late May, 2025

Meta

Senior

Comments

Your account is free and you can post anonymously if you choose.