### Prolog: Find the nth element of a list

**Give the definition of nth which returns the nth element of a list. For example nth(X,3,[a,b,c,d,e]) returns X = c.**

I couldn’t figure out how to solve this and the closest solution I found was: https://stackoverflow.com/questions…