[leetcode 24] Swap Nodes in Pairs
·
🐢 One step
LeetCode-24 swap-nodes-in-pairs : Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes note : only nodes themselves may be changed.MyAnswer :::python # Definition for singly-linked list. # class ListNode: # def init(self, val=0, next=None): # self.val = val # self.next = next class Solution: def swapPa..