We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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 scn=new Scanner(System.in);
int t=scn.nextInt();
//scn.nextLine();
for(int j=0;j<=t;j++){
String s=scn.next();
String even="";
String odd="";
for(int i=0;i<s.length();i++){
if(i%t==0){
even+=s.charAt(i);
//System.out.println(even);
}
else {
odd+=s.charAt(i);}//System.out.println(even+" "+odd);
}
System.out.println(even+" "+odd); any one check this code i got a reun time expectation i go
}
}
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →
import java.io.; import java.util.;
public class Solution {
}