Capgemini interview question

Code test for swap slice values