Simple Transposition Medium

+100 PTS

Before you start the test, check out our tutorial challenge

  • TYPE CODE PRACTICE CHALLENGE
  • LANGUAGES C++, C#, JAVA, JAVASCRIPT AND 6 MORE
    LANGUAGES C++, C#, JAVA, JAVASCRIPT, PHP, PYTHON2, PYTHON, RUBY, SWIFT, TYPESCRIPT
  • TIME ~25MIN

Simple Transposition

Challenge outline

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 August 2019 competitions. Below you can find some of them:



Have fun and good luck! :)