InferenceAI

Enter at least two characters to search.

Start free

Latency Percentile

mediumProduction AI20 min25 XP

Return the nearest-rank percentile for values and p from 0 to 100. Return 0 for empty input.

Examples

EXAMPLE WALKTHROUGHp95

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

INPUT[[10,20,30,40],95]
TASKpercentile()
EXPECTED OUTPUT40

Start with the input values shown in this example.

Example 1 of 2

Input: values = [10,20,30,40], p = 95

Output: 40

Explanation: p95

Input: values = [3,1,2], p = 50

Output: 2

Explanation: median

Hint 1

Use ceil(p/100 * n), clamped to rank one.

Topics

PythonProduction AI