[프로그래머스 스쿨]크기가 작은 부분문자열 - 숫자 범위
[문제] https://school.programmers.co.kr/learn/courses/30/lessons/147355 [풀이] 1. p의 숫자, t에서 파생되는 각 숫자들을 구하기 2. 숫자들을 비교해서 정답 구해내기 [문제가 있는 코드] 테스트케이스는 돌아가는데 실행결과는 왜 틀린 걸까.. #include #include #include // 파라미터로 주어지는 문자열은 const로 주어집니다. 변경하려면 문자열을 복사해서 사용하세요. int solution(const char* t, const char* p) { int answer = 0, pLength=0, tLength=0, bigyo=0; for(pLength=0;p[pLength]!='\0';pLength++); //p의 길이 for(..
2023.05.11