/** * Definition for singly-linked list. * type ListNode struct { * Val int *
Next *ListNode * } */ func partition(head *ListNode, x int) *ListNode { if head
head for cur != nil{ if cur.Val <x{ cur1.Next = cur cur = cur.Next cur1 =
cur1.Next }else if cur.Val >=x{ cur2.Next = cur cur = cur.Next cur2 = cur2.Next

/** * Definition for singly-linked list. * type ListNode struct { * Val int *
Next *ListNode * } */ func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode
{ up:=0; ans:= &ListNode{-1,nil}; temp:=ans; for l1!=nil || l2!=nil{ a,b:=0,0;
if(l1!=nil){ a=l1.Val; } if(l2!=nil){ b=l2.Val; }
temp.Next=&ListNode{(a+b+up)%10,nil}; up=int((a+b+up)/10); temp=temp.Next;
if(l1!=nil){ l1=l1.Next; } if(l2!=nil){ l2=l2.Next; } } if(up!=0){
temp.Next=&ListNode{up,nil}; } return ans.Next; }

/** * Definition for singly-linked list. * type ListNode struct { * Val int *
Next *ListNode * } */ func isPalindrome(head *ListNode) bool { s:=make([]int,0)
len(s)/2;i++{ if s[i]!=s[len(s)-1-i]{ return false } } return true }

skipB = 3

[5,0,1,8,4,5]。在 A 中，相交节点前有 2 个节点；在 B 中，相交节点前有 3 个节点。

/** * Definition for singly-linked list. * type ListNode struct { * Val int *