• + 1 comment

    JAVA

     public static List<Integer> matchingStrings(List<String> stringList, List<String> queries) {
        // Write your code here
            List<Integer> result = new LinkedList<Integer>();
            
            for(int i = 0; i < queries.size(); i++){
                int count = 0;
                for (int j = 0; j < stringList.size(); j++){
                    if(queries.get(i).equalsIgnoreCase(stringList.get(j))){
                        count++;
                    }                
                }
                result.add(count);            
            }
            
            return result;
    
        }