Skip to content

Instantly share code, notes, and snippets.

@amscotti
Last active December 24, 2015 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amscotti/6748748 to your computer and use it in GitHub Desktop.
Save amscotti/6748748 to your computer and use it in GitHub Desktop.
IO.inspect Enum.reduce(Enum.filter(1..999,fn(x) -> rem(x, 3) == 0 || rem(x, 5) == 0 end), 0, &1+&2)
IO.inspect 1..999 |> Enum.filter(fn(x) -> rem(x, 3) == 0 || rem(x, 5) == 0 end) |> Enum.reduce 0, &1+&2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment