Skip to content
DeepForgeby svx
All problems
MediumTime Seriests-245

Multi-Rate Sampling Count

Problem

Count samples produced by downsampling a series at several rates: sum of n // rate over the positive rates in the list.

Non-positive rates are ignored.

Hint

Multi-rate views let one model see short and long horizons simultaneously.

Test cases

case 1
in: [100,[1,10]]
expected: 110
case 2
in: [24,[2,3,4]]
expected: 26
case 3
in: [10,[]]
expected: 0
case 4
in: [5,[3]]
expected: 1
Starter codePython
def multi_rate_sampling_count(n, rates):
    # Your code here
    pass

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