Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Lambda solution in Clear category for Swap Nodes by thealfest1
swap_nodes = lambda a: ((a[i-1] if i&1 else a[i] if i==len(a)-1 else a[i+1])
for i in range(len(a)))
# i & 1 = i % 2
Feb. 3, 2019
Comments: