Skip to content
DeepForgeby svx
All problems
EasyNLPnlp-377

Zero Vector Detection

Problem

An embedding is the zero vector when its Euclidean norm is exactly zero.

Given the vector, return True when it is all zeros.

Hint

Check every coordinate.

Test cases

case 1
in: [[0,0]]
expected: true
case 2
in: [[0,0.1]]
expected: false
case 3
in: [[]]
expected: true
Starter codePython
def zero_vector_detection(vector):
    # Your code here
    pass

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