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

JAVA_LeetCode 2347_Best Poker Hand

 JAVA_LeetCode 2347_Best Poker Hand

JAVA_LeetCode 2347_Best Poker Hand 풀이 class Solution { public String bestHand(int[] ranks, char[] suits) { // 각 조건에 맞춰 반환 HashMap map = new HashMap(); int cnt = 0; for(int i = 0; i < suits.length - 1; i++){ if(suits[i] != suits[i + 1]) break; if(i == 3) return "Flush"; } for(int i = 0; i < ranks.length; i++) { map.put(ranks[i], 1 + map.getOrDefault(ranks[i], 0)); if(map.get(ranks[i]) >= 3) return "Three of a Kind"; if(map.get(ranks[i]) > cnt) cnt = map.get(ranks[i]); } if(cnt...

# JAVA # JAVA_BestPokerHand # JAVA_LeetCode2347 # JAVA_LeetCode2347_BestPokerHand # LeetCode2347_BestPokerHand