Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- suspense react-query
- ๋ฐฑ์ค 1339๋ฒ js
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- js ๋ฌธ์์ด ์์ถ
- emotion RSC
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- ์ต์ ๋์ฒด์ด๋
- app router emotion
- suspense ๋์์๋ฆฌ
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- emtion app router
- js
- ๊ตฌ๋ฆํค
- suspense ๋ณ๋ชฉํ์
- next13 emotion
- suspense ๋น๋๊ธฐ
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ๋ฐฑ์ค 1339๋ฒ nodejs
- ์ค์ฝํ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- js ์ค์ฝํ
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ์นด์นด์ค ์ฝํ
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- ๋ฐฑ์ค 2108 nodejs
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ์ฌ์ฉ์ฑ ๊ฐ์
Archives
- Today
- Total
Lennon FE
[ํ๋ก๊ทธ๋๋จธ์ค] ํฌ๋ ์ธ ์ธํ๋ฝ๊ธฐ (javascript) ๋ณธ๋ฌธ
๐ฅ Algorithm/Programmers
[ํ๋ก๊ทธ๋๋จธ์ค] ํฌ๋ ์ธ ์ธํ๋ฝ๊ธฐ (javascript)
Lennon 2021. 10. 20. 00:20728x90
๋ฐ์ํ
https://programmers.co.kr/learn/courses/30/lessons/64061?language=javascript
์ฝ๋ฉํ ์คํธ ์ฐ์ต - ํฌ๋ ์ธ ์ธํ๋ฝ๊ธฐ ๊ฒ์
[[0,0,0,0,0],[0,0,1,0,3],[0,2,5,0,1],[4,2,4,4,2],[3,5,1,3,1]] [1,5,3,5,1,2,1,4] 4
programmers.co.kr
function solution(board, moves) {
let stack = [];
let count = 0;
for(let i = 0; i < moves.length; i++){
for(let j = 0; j < board.length; j++){
if(board[j][moves[i]-1] === 0) continue;
else {
if(stack[stack.length-1] === board[j][moves[i]-1]){
board[j][moves[i]-1] = 0;
count+=2;
stack.pop();
break;
}
stack.push(board[j][moves[i]-1]);
board[j][moves[i]-1] = 0;
break;
}
}
}
return count;
}
728x90
๋ฐ์ํ
'๐ฅ Algorithm > Programmers' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ฐ์ฅ ํฐ ์ (js) (0) | 2021.10.25 |
---|---|
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ธฐ๋ฅ ๊ฐ๋ฐ (js) (0) | 2021.10.25 |
[ํ๋ก๊ทธ๋๋จธ์ค] 1์ฐจ ์บ์ (javaScript) (0) | 2021.10.07 |
[ํ๋ก๊ทธ๋๋จธ์ค] ํ๋ ์ฆ 4๋ธ๋ก (javascript) (0) | 2021.09.25 |
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ (javascript) (0) | 2021.09.25 |
Comments