Skip to content

Commit 80f2130

Browse files
authored
Update dot-product-of-two-sparse-vectors.cpp
1 parent 3b0f512 commit 80f2130

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/dot-product-of-two-sparse-vectors.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class SparseVector {
2020
int result = 0;
2121
for (const auto& [i, v] : a->lookup_) {
2222
if (b->lookup_.count(i)) {
23-
result += a->lookup_[i] * b->lookup_[i];
23+
result += v * b->lookup_[i];
2424
}
2525
}
2626
return result;

0 commit comments

Comments
 (0)