1570. Dot Product of Two Sparse Vectors
[LeetCode] 1570. Dot Product of Two Sparse Vectors
1570. Dot Product of Two Sparse Vectors Medium Given two sparse vectors, compute their dot product. Implement class SparseVector: SparseVector(nums) Initializes the object with the vector nums dotProduct(vec) Compute the dot product between the instance of SparseVector and vec A sparse vector is a vector that has mostly zero values, you should store the sparse vector efficiently and compute the ..