Skip to content

Commit 5928dbd

Browse files
committed
card bundle / 以�
1 parent d2dc9af commit 5928dbd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

JustDevRae/Queue/card_bundle.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function solution(cards1, cards2, goal) {
2+
var answer = "";
3+
for (let word of goal) {
4+
if (word == cards1[0]) {
5+
cards1.shift();
6+
} else if (word == cards2[0]) {
7+
cards2.shift();
8+
} else {
9+
answer = "No";
10+
break;
11+
}
12+
}
13+
14+
return (answer = "Yes");
15+
}

0 commit comments

Comments
 (0)