Sponsored
Use these hints if you're stuck. Try solving on your own first.
Because the vector is sparse, use a data structure that stores the index and value where the element is nonzero.
Solve with full IDE support and test cases