[Algorithm] 4 week(1.30 ~ 2.6) 2/3

Dev_min·2022년 2월 2일
1

algorithm

목록 보기
11/157

2114. Maximum Number of Words Found in Sentences

var mostWordsFound = function(sentences) {
    const result = [];
    
    for(let i = 0; i < sentences.length; i++){
        result.push(sentences[i].split(' ').length);
    }
    
    result.sort((a, b) => b - a);
    
    return result[0]
};
profile
TIL record

1개의 댓글

comment-user-thumbnail
2022년 2월 2일

연락 부탁 드리겠습니다. sam.joung@thelabs.kr

답글 달기