
January 2022. The maintainer of colors and faker, two npm packages pulled billions of times, deliberately sabotages his own code. He ships an update with an infinite loop that spits out LIBERTY over and over then a wall of garbage, and thousands of apps that trusted those packages hang instantly. Here is the same loop: it is supposed to chant a fixed number of times, but it never stops. Make it terminate.
Repair this code
Repair the loop so it prints LIBERTY exactly n times instead of forever.
Steps
$ chant(3)
LIBERTY LIBERTY LIBERTY
$ chant(1)
LIBERTY
Expected files
Allowed functions
Loading solutions...