본문으로 바로가기
728x90
반응형

문제

 

반응형

풀이

 

 

 

1
2
3
4
5
6
7
8
9
10
11
class Solution {
    public int solution(String t, String p) {
        int answer = 0;
        for(int i=0; i<t.length()-p.length()+1; i++) {
            if(Long.parseLong(t.substring(i, i+p.length())) <= Long.parseLong(p)) {
                answer++;
            }
        }
        return answer;
    }
}
cs

 

728x90
반응형