Skip to content

Instantly share code, notes, and snippets.

@chrisdel101
Created February 20, 2023 16:47
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 chrisdel101/50a398070f03fabf3d4fb5916a33124d to your computer and use it in GitHub Desktop.
Save chrisdel101/50a398070f03fabf3d4fb5916a33124d to your computer and use it in GitHub Desktop.
Sum sqaures
defmodule SquareSum do
def square_sum([head | tail]) do
(head * head) + square_sum(tail)
end
def square_sum([]) do
0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment