Skip to content

Instantly share code, notes, and snippets.

@lnicola
Created June 26, 2014 12:11
Show Gist options
  • Save lnicola/ca5ce6126bb619c5f038 to your computer and use it in GitHub Desktop.
Save lnicola/ca5ce6126bb619c5f038 to your computer and use it in GitHub Desktop.
mergeUniq (x : xs) (y : ys) = if x < y
then x : mergeUniq xs (y : ys)
else if y < x
then y : mergeUniq (x : xs) ys
else x : mergeUniq xs ys
mergeUniq xs [] = xs
mergeUniq [] ys = ys
mult n = map (* n) [1..]
ans = mult 2 `mergeUniq` mult 3 `mergeUniq` mult 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment