encrypt with permutation ciphers I came across this question:

You are given a permutation cipher defined by the bijection t: N -> N where, 

t(i) = i + 10, for i &lt; 10,
t(i) = i - 10, for 10 &lt;= i &lt;= 20, and
t(i) = i, for i &gt; 20.


Assume that the first index is 0, given a message m = 'HELLO WORLD AND THIS IS A SECRET MESSAGE', what is the ciphertext c?

Where the answer was the following:

D AND THISHELLO WORL IS A SECRET MESSAGE


but i don't get how. That's now what we get if the message is spelled out diagonally
down and up over a number of rows and then read off row-by-row.
Just apply the given permutation on the string. 

Your string is : 'HELLO WORLD AND THIS IS A SECRET MESSAGE'.

Now, to apply the given permutation, we have to shift the first 10 characters rightward by 10 units, and the next 10 characters leftwards by 10 units, while leaving the rest same. Note that you also need to count the spaces.