Created
October 1, 2022 15:10
-
-
Save jacobat/04ccfbc84c50daa83ae0db42a17dd1ad to your computer and use it in GitHub Desktop.
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
Enum.reduce_while(list, [], fn x, acc -> | |
if Enum.member?(acc, x), do: {:halt, x}, else: {:cont, [x | acc]} | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment