Your method can't going on In most cases. For 1,3,5, the first let it to 1,3,2. You try 1,3,1.....second lost.