Skip to content
DeepForgeby svx
All problems
EasyLinear Algebrala-004

Vector Dot Product

Problem

Compute the dot product of two equal-length vectors a and b: sum(a[i] * b[i]).

Test cases

case 1
in: [[1,2,3],[4,5,6]]
expected: 32
case 2
in: [[0,0,0],[1,2,3]]
expected: 0
case 3
in: [[2,2],[3,3]]
expected: 12
Starter codePython
def dot(a, b):
    # Your code here
    pass

3 test cases · run your code against them in the editor