[Algorithm] 18 week(5.16 ~ 5.22) 2/3

Dev_min·2022년 5월 18일
0

algorithm

목록 보기
60/157

2255. Count Prefixes of a Given String

var countPrefixes = function(words, s) {
    let count = 0;
    words.forEach((word) => {
        if(s.startsWith(word)){
            count += 1;
        }
    })
    
    return count;
};
profile
TIL record

0개의 댓글