Problem: Reverse a singly linked list recursively.

I know how to solve this problem, but one of my recursive methods is wrong, I can not figure out what's wrong with this code. Could anyone figure out that? Thanks a lot!

Test case: Input: [1,2,3] Output: [3,1] Expected: [3,2,1]

```
public class Solution {
// recursive
ListNode last = null;
public ListNode reverseList(ListNode head) {
if (head == null) return null;
helper(head);
return last;
}
private ListNode helper(ListNode head) {
// base case
if (head.next == null) {
last = head;
return head;
}
// general case
ListNode prev = reverseList(head.next); // should be ListNode prev = helper(head.next);
prev.next = head;
head.next = null;
return head;
}
}
```