InferenceAI

Enter at least two characters to search.

Start free

Cache Hit Rate

easyInference12 min10 XP

Given booleans where true means hit, return the hit rate rounded to six decimals.

Examples

EXAMPLE WALKTHROUGHmixed

A guided view of the published example, not a trace of your code.

INPUT[[true,false,true]]
TASKcache_hit_rate()
EXPECTED OUTPUT0.666667

Start with the input values shown in this example.

Example 1 of 2

Input: events = [true,false,true]

Output: 0.666667

Explanation: mixed

Input: events = []

Output: 0

Explanation: empty

Hint 1

Booleans can be summed in Python.

Topics

PythonInference