working swap case soln in rb