This is the pattern that I want to print.
1 3 2 6 5 4 10 9 8 7
Now I have a solution but I don\'t know how exactly it is working