Added custom solution to Problem 9 of linked list