Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Swap Nodes by kerimlcr
def swap_nodes(a):
for i in range(0, len(a), 2):
try:
tmp = a[i + 1]
a[i + 1] = a[i]
a[i] = tmp
except IndexError:
pass
return a
Feb. 23, 2020