翻译合并两个排好序的链表,并返回这个新链表。新链表应该由这两个链表的头部拼接而成。原文Merge two sorted linked lists and return it as a new list.The new list should be made by splicing together the nodes of the first two lists.代码/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next;
翻译翻转一个整型数例 1:x = 123, 返回 321例 2:x = -123, 返回 -321原文Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321Have you thought about this? (来自 LeetCode 官网)Here are some good questions to ask before coding.Bonus points for you if you have already thought through this!