Created
December 7, 2020 21:28
-
-
Save SophieDeBenedetto/6457148c22aad28600e5c32f58f90649 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Accountant do | |
| @sum 2020 | |
| def product_of_equals_twenty_twenty([]), do: :noop | |
| def product_of_equals_twenty_twenty([_head | tail] = list) do | |
| product = get_two(list) | |
| if product do | |
| product | |
| else | |
| product_of_equals_twenty_twenty(tail) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment