All problems
Curriculum Difficulty Ratio
Problem
Compute the fraction of training prompts inside the learning zone, whose success rate lies in [low, high] inclusive. An empty list returns 0.0.
Hint
Prompts that are too easy or too hard give little learning signal.
Test cases
case 1
in: [[0.1,0.5,0.9],0.3,0.7]
expected: 0.3333333333333333
case 2
in: [[0,1],0.3,0.7]
expected: 0
case 3
in: [[0.3,0.7],0.3,0.7]
expected: 1
case 4
in: [[],0.3,0.7]
expected: 0
Starter codePython
def curriculum_difficulty_ratio(success_rates, low, high):
# Your code here
pass4 test cases · run your code against them in the editor