implement count(), getNth and clear() from LinkedListProblems