Skip to content

Instantly share code, notes, and snippets.

@petros
Last active August 24, 2022 13:03
Show Gist options
  • Save petros/d6631a35a83dde4019024667c6a1a1d3 to your computer and use it in GitHub Desktop.
Save petros/d6631a35a83dde4019024667c6a1a1d3 to your computer and use it in GitHub Desktop.
Boutique Suggestions - Elixir - Exercism
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