Skip to content

Instantly share code, notes, and snippets.

@chrisdel101
Created February 20, 2023 16:47
Show Gist options
  • Select an option

  • Save chrisdel101/50a398070f03fabf3d4fb5916a33124d to your computer and use it in GitHub Desktop.

Select an option

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