working swap elements rb soln