Skip to content

Instantly share code, notes, and snippets.

@DrunkenAlcoholic
Created May 14, 2024 03:51
Show Gist options
  • Save DrunkenAlcoholic/30c0d79e6918708469cb57c5c869f04c to your computer and use it in GitHub Desktop.
Save DrunkenAlcoholic/30c0d79e6918708469cb57c5c869f04c to your computer and use it in GitHub Desktop.
Sum Of Multiples [Exercism - Nim]
proc sum*(limit: int, factors: openArray[int]): int =
for i in 0..<limit:
for num in factors:
if num != 0 and i mod num == 0:
result += i
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment