We must calculate the dot product of two given sparse vectors, nums1 and nums2.
Create a SparseVector class:
Note: A sparse vector is a vector that contains mostly zero values. Therefore, we should store the sparse vectors and calculate the dot product accordingly.
Constraints: