작성
·
207
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";