99 Elm Problems/Lists Problem 1/Find the last element of a list

Find the last element of a list. Assume a non-empty list.

Example in Elm:

Result:

Solutions