Module 13 · In your browser · challenge 2 of 3 in this lesson

percentile sorts a copy with table.clone

A code cell with the real Luau runner grades it. No Studio needed.

Open

Luau
Ctrl Enter runs the cell. Checked by tests

Level 2, Builder

Challenge

Fix percentile in the percentile-cell Run above.

Start from
The game at milestone m14 (download)
Check it here
Run the code cell; the challenge completes when it passes. No Studio needed.

Done means

  • percentile sorts a copy with table.clone
  • It returns the value at rank ceil(p / 100 * n), clamped to 1..n, and 0 for no samples
  • Every test in percentile-cell passes