Problem
Function getnth that takes a list and an int n and returns the nth element of the list, where the head of the list is the 1st element. You are only allowed to use list functions hd and tl in your solution - no other built-in functions are allowed. If the list is empty or n is invalid, return a tuple: {error, no_such_element}.