public int solution(String t, String p) {
int len = p.length();
long num = Long.parseLong(p);
int result = 0;
for (int i = 0; i <= t.length() - len; i++) {
long diff = Long.parseLong(t.substring(i, i + len));
if (diff <= num) {
result++;
}
}
return result;
}
출처:https://school.programmers.co.kr/learn/courses/30/lessons/147355