-
-
Save petros/d6631a35a83dde4019024667c6a1a1d3 to your computer and use it in GitHub Desktop.
Boutique Suggestions - Elixir - Exercism
This file contains 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 BoutiqueSuggestions do | |
def get_combinations(tops, bottoms, options \\ []) do | |
mp = Keyword.get(options, :maximum_price, 100.0) | |
for x <- tops, | |
y <- bottoms, | |
x.base_color != y.base_color and x.price + y.price <= mp do | |
{x, y} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment