View

๋ฐ˜์‘ํ˜•
class Solution {
    public boolean solution(String s) {
        boolean answer =true;
        
        if(s.length()!=4 && s.length()!=6) answer=false;
           for (int i=0; i<s.length(); i++){
	            char c= s.charAt(i);
	            if ((c>='A' && c<='Z') || (c>='a' && c<='z')){
	                answer=false;
	            }
	        }
        return answer;
    }
}

1. charAt()์œผ๋กœ ๋ณ€ํ™˜์‹œํ‚จ ๋’ค ๋ฒ”์œ„ ํ™•์ธ 

๋ฐ˜์‘ํ˜•
Share Link
reply
๋ฐ˜์‘ํ˜•
ยซ   2024/11   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
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