-
카테고리
-
세부 분야
알고리즘 · 자료구조
-
해결 여부
미해결
코드리뷰 부탁드리겠습니다.
23.01.25 23:56 작성 조회수 177
0
function solution(str, list) {
let mustWord = str.split(''); // c, b, a
let fullWord = list.split('');
while (fullWord.length !== 0) {
if (mustWord[mustWord.length-1] === fullWord[fullWord.length-1]) {
mustWord.pop();
fullWord.pop();
} else {
fullWord.pop();
}
}
return mustWord.length !== 0 ? "NO" : "YES";
답변을 작성해보세요.
0
답변 1