Skip to content
DeepForgeby svx
All problems

Curriculum Threshold Advance

Problem

Advance a curriculum level when performance meets the threshold.

Return level + 1 when success_rate >= threshold and level < max_level; otherwise return the current level.

Hint

The threshold is inclusive: exactly meeting it advances the level.

Test cases

case 1
in: [2,0.8,0.8,5]
expected: 3
case 2
in: [5,0.9,0.8,5]
expected: 5
case 3
in: [0,0.5,0.8,5]
expected: 0
Starter codePython
def curriculum_advance(level, success_rate, threshold, max_level):
    # Your code here
    pass

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