Skip to content

Commit 2a96f89

Browse files
Merge pull request #1936 from CodingTestStudy2/황은지
[황은지] Day32
2 parents cea0911 + 754ae63 commit 2a96f89

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @param {number[]} stones
3+
* @return {boolean}
4+
*/
5+
var canCross = function(stones) {
6+
const dp =Array.from({length:stones.length},()=>Array(3).fill(false));
7+
dp[1][1]=true;
8+
9+
// 길이는 전길이에 따라 달라짐
10+
for(let i=0;i<stones.length-1;i++){
11+
const pos=stones[i];
12+
for(let j=0;j<3;j++){
13+
if(dp[i][j]===true){
14+
}
15+
}
16+
}
17+
18+
return true;
19+
};

0 commit comments

Comments
 (0)