__author__ = 'don'
"""
Reverse linked list
"""
class Solution:
    # @param {ListNode} head
    # @return {ListNode}
    def reverseList(self, head):
        if not head:
            return head
        else:
            return self.listHelper(None,head)

    def listHelper(self, t1, t2):
        if not t2:
            return t1
        tmp = t2.next
        t2.next = t1

        return self.listHelper(t2, tmp)

5957e506ddd6626f441d9bfd80827bf309a533f5
<mask token>

<mask token>


class Solution:
    <mask token>

    def listHelper(self, t1, t2):
        if not t2:
            return t1
        tmp = t2.next
        t2.next = t1
        return self.listHelper(t2, tmp)

<mask token>


class Solution:

    def reverseList(self, head):
        if not head:
            return head
        else:
            return self.listHelper(None, head)

    def listHelper(self, t1, t2):
        if not t2:
            return t1
        tmp = t2.next
        t2.next = t1
        return self.listHelper(t2, tmp)

__author__ = 'don'
<mask token>


class Solution:

    def reverseList(self, head):
        if not head:
            return head
        else:
            return self.listHelper(None, head)

    def listHelper(self, t1, t2):
        if not t2:
            return t1
        tmp = t2.next
        t2.next = t1
        return self.listHelper(t2, tmp)

__author__ = 'don'
"""
Reverse linked list
"""
class Solution:
    # @param {ListNode} head
    # @return {ListNode}
    def reverseList(self, head):
        if not head:
            return head
        else:
            return self.listHelper(None,head)

    def listHelper(self, t1, t2):
        if not t2:
            return t1
        tmp = t2.next
        t2.next = t1

        return self.listHelper(t2, tmp)
