[Algorithm] 문자열안에 문자열

yeah·2023년 10월 19일

Algorithm

목록 보기
19/27
post-thumbnail

Mission.

작성한 답

function solution(str1, str2) {
    if (str1.indexOf(str2) !== -1) {
        return 1;
    } else {
        return 2;
    }
}

참고 자료

https://school.programmers.co.kr/learn/courses/30/lessons/120908

profile
기록과 회고

0개의 댓글