Java 풀이
class Solution {
public boolean solution(String s) {
boolean answer = true;
char temp;
for(int i = 0; i < s.length(); i++) {
temp = s.charAt(i);
if(!(s.length() == 4 || s.length() == 6)) {
answer = false;
}
if(!('0' <= temp && temp <= '9')) {
answer = false;
}
}
return answer;
}
}