Swap elements solution