Challenge overview
Hello and welcome to the challenge!
Write a code which encrypts a string using the simple transposition method. In this method you should create 2 new strings and put even-indexed characters (including index 0
) to the first and odd-indexed ones to the second. Next concatenate the strings.
Example
simpleTransposition("abab12") -> "aa1bb2"
Input
- input string
S
Output
- string
S
after encryption
Constraints
0 < length of S < 1000
You can solve this programming contest in C#, C++, Java, Ruby, JavaScript, Python, PHP and many more languages. If you want, you can also take part in other Challenges. Below you can find some of them:
Have fun and good luck! :)