Percentile from sorted array

Code reviewHard18 min

Your task

Review this Go function that returns the p-th percentile latency from a sorted slice (e.g. p=95 for p95).

sorted is ascending and non-empty; p is in [0, 100].