The above problem seems to be the encoding and decoding type of problem. The sender sends the expression code with the expression jumbled up with code. This problem will be easily taken care of...
From the above example it is clear that the jumbling up is done "by rotation".. IF at the receiver end the code handles the string array such that it rotates the elements to the right then the actual code expression can be obtained. Try it now, if u cnt do then ask for the code..