로딩
요청 처리 중입니다...

JAVA_LeetCode 3541_Find Most Frequent Vowel and Consonant

 JAVA_LeetCode 3541_Find Most Frequent Vowel and Consonant

JAVA_LeetCode 3541_Find Most Frequent Vowel and Consonant 풀이 class Solution { public int maxFreqSum(String s) { // 각 모음, 자음별 hashmap 변수에 키별 값을 저장한다음 최대값을 찾는다. HashMap map = new HashMap(), map2 = new HashMap(); int max = 0, max2 = 0; for(char ch : s.toCharArray()) { if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') map.put(ch, map.getOrDefault(ch, 0) + 1); else map2.put(ch, map2.getOrDefault(ch, 0) + 1); } for(int num : map.values()) max = Math.max(max, num...