Skip to content
DeepForgeby svx

Problem

Compute the number of usable steps after R2D2-style burn-in: seq_len - burn_in, floored at 0 when the burn-in consumes the whole sequence.

Hint

Burn-in lets the recurrent state warm up before gradients are applied.

Test cases

case 1
in: [80,40]
expected: 40
case 2
in: [40,40]
expected: 0
case 3
in: [20,40]
expected: 0
case 4
in: [10,0]
expected: 10
Starter codePython
def r2d2_usable_steps(seq_len, burn_in):
    # Your code here
    pass

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