The recursive thinking:
- If the list is empty, then the thing you want to find is definitely not in that list.
- If the first element is what you want to find, then you found it.
- If the first element is not what you want to find, then find that thing in the rest of the list (which is still a list, could be empty, though)
So the code is
def exist?([], _item), do: false
def exist?([item | _tail], item), do: true
def exist?([_something_else | tail], item), do: exist?(tail, item)






















