Coding
Dot Product of Two Sparse Vectors
Calculate the dot product of two sparse vectors.
Input: nums1 = [0,1,0,0,2], nums2 = [0,0,0,0,5]
Output: 10
Explanation: Multiplies the aligned non-zero values (2 * 5) and ignores all the zeros, yielding a dot product of 10.
Was asked at