LeetCode-Feedback / LeetCode-Feedback

675 stars 333 forks source link

merge-two-sorted-lists bug #9124

Closed vantihovich closed 2 years ago

vantihovich commented 2 years ago

Your LeetCode username vao001

Category of the bug

Description of the bug

Ive got an issue when trying to run code in  "merge-two-sorted-lists" problem. After pushing button "run code" Im getting the following message : Compile error Line 31: Char 19: undefined: Deserializer (solution.go)

Line 32: Char 33: undefined: Deserializer (solution.go) Line 75: Char 34: undefined: Serializer (solution.go)

Code you used for Submit/Run operation

type ListNode struct {
Val  int
Next *ListNode
}

func mergeTwoLists(list1 ListNode, list2 ListNode) *ListNode {
list := ListNode{}
list.Next = nil
last := &list

for list1 != nil || list2 != nil {
if list1 == nil {
last.Next = list2
break
} else if list2 == nil {
last.Next = list1
break
} else {
if list1.Val <= list2.Val {
last.Next = list1
list1 = list1.Next
} else {
last.Next = list2
list2 = list2.Next
}
last = last.Next
}
}
return list.Next
}

Language used for code GoLang

Expected behavior

Expecting no compile errors, running the code with test cases

Screenshots

Additional context

LC-Pam commented 2 years ago

Thank you for reaching out to us, the judger appears to be working correctly, please feel free to refer to the discuss section of the problem to see how other users' have optimized their codes!