You are viewing a single comment's thread. Return to all comments →
Java Solution
public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); for(int i=0;i<n;i++){ String s = sc.nextLine(); String oddString=""; for(int j =0 ;j<s.length();j++){ if(j % 2 == 0) System.out.print(s.charAt(j)); else oddString+=s.charAt(j); } System.out.println(" "+oddString); } }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →
Java Solution
}