티스토리 뷰

 

 

💡 나의 풀이

채점 결과
정확성: 100.0
합계: 100.0 / 100.0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class Solution {
  public boolean solution(String s) {
      boolean answer = false;
      
      int length = s.length();
      
      if(length == 4 || length == 6){
          answer = true;
      }
      
      for(int i = 0; i < length; i++){
          char chkint = s.charAt(i);
          if(chkint < '0' || chkint > '9'){
              answer = false;
          }
      }
      
      return answer;
  }
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
 
댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31