Skip to content
DeepForgeby svx
All problems

HER Future Window

Problem

Return the inclusive index range of future goals for hindsight relabeling.

The window starts at max(t + 1, T - horizon) and ends at T - 1. Return [] when the window is empty.

Hint

The horizon caps how far ahead relabeled goals may come from.

Test cases

case 1
in: [0,10,5]
expected: [5,9]
case 2
in: [7,10,5]
expected: [8,9]
case 3
in: [9,10,5]
expected: []
case 4
in: [4,5,10]
expected: []
Starter codePython
def her_future_window(t, T, horizon):
    # Your code here
    pass

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