Swap Nodes In Pairs Leetcode Solution Python