Given a linked list, find its length. The length of a linked list is the number of its elements.
Definition of a single linked list:
Implement function length to find the length of linked list.
The length of a linked list is 3.