Skip to content

Instantly share code, notes, and snippets.

@sachinkmohan
Last active June 13, 2026 11:04
Show Gist options
  • Select an option

  • Save sachinkmohan/76d38ccc2db44bc3f0c434904d5ee471 to your computer and use it in GitHub Desktop.

Select an option

Save sachinkmohan/76d38ccc2db44bc3f0c434904d5ee471 to your computer and use it in GitHub Desktop.
JS Puzzles
  1. Difficulty: ⭐⭐⭐ (Hard)
function puzzle(a, b) {
  return a === b ? a : puzzle(b, a % b);
}

console.log(puzzle(48, 18));  // ?
console.log(puzzle(100, 50)); // ?
console.log(puzzle(17, 5));   // ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment