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 ๋น๋๊ธฐ
- ์ค์ฝํ
- ๋ฐฑ์ค 1339๋ฒ js
- suspense ๋ณ๋ชฉํ์
- suspense react-query
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- ๋ฐฑ์ค 2108 nodejs
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- ์ฌ์ฉ์ฑ ๊ฐ์
- js ๋ฌธ์์ด ์์ถ
- ๋ฐฑ์ค 1339๋ฒ nodejs
- js ์ค์ฝํ
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ์นด์นด์ค ์ฝํ
- ์ต์ ๋์ฒด์ด๋
- suspense ๋์์๋ฆฌ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- app router emotion
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- ๊ตฌ๋ฆํค
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- emtion app router
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- emotion RSC
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- next13 emotion
- js
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
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
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