Skip to content

Instantly share code, notes, and snippets.

@gpDA
Created February 23, 2022 16:45
Show Gist options
  • Save gpDA/978e98b6e8f613b7725c4e66a99d56c3 to your computer and use it in GitHub Desktop.
Save gpDA/978e98b6e8f613b7725c4e66a99d56c3 to your computer and use it in GitHub Desktop.
// recursion
const recursiveFindRange = (low, high) => {
if (low === high - 2) return [high - 1];
let res = recursiveFindRange(low, high - 1)
res.push(high - 1);
return res;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment