You are viewing a single comment's thread. Return to all comments →
Here is my code import java.io.; import java.util.;
public class Solution {
public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); ArrayList<String> name=new ArrayList<String>(); for(int i=0;i<n;i++) name.add(sc.next()); int q=sc.nextInt(); for(int i=0;i<q;i++) System.out.println(Collections.frequency(name,sc.next())); }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
Here is my code import java.io.; import java.util.;
public class Solution {
}