All problems
Reward-Free Exploration Count
Problem
Choose the least-visited state for reward-free exploration.
Return the index with the smallest visit count, breaking ties toward the smallest index. An empty list returns -1.
Hint
A strict less-than comparison makes the first minimum win ties.
Test cases
case 1
in: [[3,1,2]]
expected: 1
case 2
in: [[5,5,5]]
expected: 0
case 3
in: [[2,0,1,0]]
expected: 1
case 4
in: [[]]
expected: -1
Starter codePython
def reward_free_exploration_count(visit_counts):
# Your code here
pass4 test cases · run your code against them in the editor