JAVA help please!
Posted: Fri Jul 08, 2022 6:45 am
JAVA help please!
3. Using HashSet<Character>, write an efficient method in Java that gets two Strings as input parameters and counts the number of distinct characters that appear in both parameters. Here is the method's signature: public static int countMutualCharacters(String s1, String s2){ //Your code here } Example: returns 4 (t, i, g, e) countMutualCharacters("flight attendent", "trigger")
3. Using HashSet<Character>, write an efficient method in Java that gets two Strings as input parameters and counts the number of distinct characters that appear in both parameters. Here is the method's signature: public static int countMutualCharacters(String s1, String s2){ //Your code here } Example: returns 4 (t, i, g, e) countMutualCharacters("flight attendent", "trigger")