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")
JAVA help please!
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am