Skip to content
DeepForgeby svx
All problems
EasyInformation Theoryinfo-099

Error Correction Capability

Problem

Return the number of errors a code with minimum distance d can always correct: t = floor((d - 1) / 2).

Hint

Correctable error spheres of radius t must not overlap.

Test cases

case 1
in: [1]
expected: 0
case 2
in: [2]
expected: 0
case 3
in: [3]
expected: 1
case 4
in: [7]
expected: 3
case 5
in: [4]
expected: 1
Starter codePython
def error_correction_capability(d):
    # Your code here
    pass

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