Skip to content

Instantly share code, notes, and snippets.

@jaideepjagyasi
Created March 22, 2018 17:54
Show Gist options
  • Save jaideepjagyasi/b9049cdc62f53ed6ace597adaab5d97d to your computer and use it in GitHub Desktop.
Save jaideepjagyasi/b9049cdc62f53ed6ace597adaab5d97d to your computer and use it in GitHub Desktop.
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int i=1;i<=T;i++)
{
String s=sc.next();
for(int j=0;j<s.length();j+=2){
System.out.print(s.charAt(j));
}
System.out.print(" ");
for(int j=1;j<s.length();j+=2){
System.out.print(s.charAt(j));
}
System.out.println();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment