Skip to content

Instantly share code, notes, and snippets.

@kmurudi
Created September 22, 2017 14:10
Show Gist options
  • Select an option

  • Save kmurudi/a5fe30c01a1495356c8350a4b8a42b8d to your computer and use it in GitHub Desktop.

Select an option

Save kmurudi/a5fe30c01a1495356c8350a4b8a42b8d to your computer and use it in GitHub Desktop.
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
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. */
ArrayList list1 = new ArrayList();
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 1;i<=n;i++){
list1.add(sc.nextLine());
}
Iterator it = list1.iterator( );
while ( it.hasNext( ) ) {
System.out.println( it.next( ) );
}
int q = sc.nextInt();
//String[] ary = list1.get(0).split("");
ArrayList list2 = new ArrayList();
for (int i = 1;i<=q;i++){
list2.add(sc.nextLine());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment