Skip to content

Instantly share code, notes, and snippets.

@viniciusarre
Last active October 5, 2021 23:00
Show Gist options
  • Select an option

  • Save viniciusarre/da807ffdb0a3f1aeff63d040323642d3 to your computer and use it in GitHub Desktop.

Select an option

Save viniciusarre/da807ffdb0a3f1aeff63d040323642d3 to your computer and use it in GitHub Desktop.
const boundedRatio = (a, l, r) => {
return a.map((v, i) => {
for (let x = l; x <= r; x++) {
return (i + 1) * x == v;
}
})
}
const v = [1, 2, 3, 4, 5]
const r = l = 1
console.log(boundedRatio(v, l, r))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment