Skip to content

Instantly share code, notes, and snippets.

@greystate
Created November 17, 2025 21:24
Show Gist options
  • Select an option

  • Save greystate/0863d3b3733026590912b39369befa58 to your computer and use it in GitHub Desktop.

Select an option

Save greystate/0863d3b3733026590912b39369befa58 to your computer and use it in GitHub Desktop.
Solution for 'Interview question of the week' (week 47)
function repeatedIntegers(i) {
let repeats = []
while (i > 0) {
repeats.push(Array.from({ length: i }, (v, n) => i))
i -= 1
}
return repeats.flat()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment