All problems
Ape-X Actor Count
Problem
Compute how many distributed actors are needed to hit a target transition rate.
Return ceil(target_rate / rate_per_actor). A non-positive rate per actor or target rate returns 0.
Hint
Ape-X scales exploration by adding actors, not by stretching a single stream.
Test cases
case 1
in: [100,8]
expected: 13
case 2
in: [32,8]
expected: 4
case 3
in: [0,5]
expected: 0
case 4
in: [5,0]
expected: 0
case 5
in: [9,4]
expected: 3
Starter codePython
import math
def apex_actor_count(target_rate, rate_per_actor):
# Your code here
pass5 test cases · run your code against them in the editor