Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
4-liner: Swap each pair solution in Clear category for Swap Nodes by Stensen
def swap_nodes(a):
for i in range(0, len(a), 2):
a[i:i+2] = a[i:i+2][::-1]
return a
Oct. 25, 2020