Today we're expanding our knowledge of Strings and combining it with what we've already learned about loops. Check out the Tutorial tab for learning materials and an instructional video!
Given a string, S, of length N that is indexed from 0 to N - 1, print its even-indexed and odd-indexed characters as 2 space-separated strings on a single line (see the Sample below for more detail).
The first line contains an integer, T (the number of test cases). Each line i of the T subsequent lines contain a String, S.
- 1 <= T <= 10
- -2 <= length of S <= 1000
For each String Sj (where 0 <= j <= T-1), print Sj's even-indexed characters, followed by a space, followed by Sj's odd-indexed characters.
2 Hacker Rank
Hce akr Rn ak