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

JAVA_LeetCode 2437_Number of Valid Clock Times

 JAVA_LeetCode 2437_Number of Valid Clock Times

JAVA_LeetCode 2437_Number of Valid Clock Times 풀이 class Solution { public int countTime(String time) { // 시, 분 값에 따라 조건에 맞춰 곱하거나 값을 초기화해준다. int res = 1; if(time.charAt(0) == '?'){ if(time.charAt(1) >= '4' && time.charAt(1) <= '9') res *= 2; else res *= 3; } if(time.charAt(1) == '?')

{ if(time.charAt(0) == '?') res = 24; else if(time.charAt(0) == '2') res *= 4; else res *= 10; } if(time.charAt(3) == '?')

res *= 6; if(time.charAt(4) == '?' ) res *= 10; return res; } } * 출처 https://leetcode.com/prob...

# JAVA # JAVA_LeetCode2437 # JAVA_LeetCode2437_NumberofValidClockTimes # JAVA_NumberofValidClockTimes # LeetCode2437_NumberofValidClockTimes