You are viewing a single comment's thread. Return to all comments →
public static List<Integer> matchingStrings(List<String> strings, List<String> queries) { // Write your code here List<Integer> finalList = new ArrayList<>(); Integer tempValue=0; for(String s1 :queries){ for(String s2 :strings){ if((s1.equals(s2))){ tempValue ++; } } finalList.add(tempValue); tempValue = 0; } return finalList; }
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 →