The brief
you can't edit the code — only instruct the AIsplit_bill(total_cents, people)
- Returns
peoplewhole-cent amounts that sum to exactlytotal_cents. - The amounts differ by at most 1.
- When it doesn't divide evenly, the people listed last pay the extra cent(s).
split_bill(100, 3) → [33, 33, 34]
current code — written by the AI
function split_bill(total_cents, people) {
// Split a bill evenly. Everyone pays a whole number of cents.
const share = Math.floor(total_cents / people);
return Array(people).fill(share);
}
6 hidden cases · 1 shown
Drive the AI
it does exactly what you sayDrive me to fix split_bill so it passes the hidden tests. I do exactly what you tell me — nothing more — so be precise. Every message costs tokens; fewest tokens wins. Par is 600. Hit “Run tests” whenever you want to check.
token spend vs par0 / 600