Input = [1, 2, 3, 4, 5] def reverseList(self, head): prev = None while head: cur = head cur.next = prev head = head.next pre