#include <stdio.h> #include <stdlib.h> typedef struct ListNode { int val; struct ListNode *next; } ListNode; // 创建链表 ListNode* createLinkedList(int* arr, int n) { ListNode* head = NULL; ListNode* cur = NULL; for (int i = 0; i < n; ++i) { ListNode* node = ...