func reverseList(head *ListNode) *ListNode {
if head == nil || head.Next == nil {
return head
}
current := head
var previous *ListNode
for current != nil {
next := current.Next
current.Next = previous
previous = current
current = next
}
return previous
}