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 ๋ณ๋ชฉํ์
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ์ค์ฝํ
- emtion app router
- ์ต์ ๋์ฒด์ด๋
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- ์ฌ์ฉ์ฑ ๊ฐ์
- js ๋ฌธ์์ด ์์ถ
- next13 emotion
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- suspense ๋น๋๊ธฐ
- ๋ฐฑ์ค 2108 nodejs
- ๋ฐฑ์ค 1339๋ฒ js
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- ์นด์นด์ค ์ฝํ
- ๋ฐฑ์ค 1339๋ฒ nodejs
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- emotion RSC
- js ์ค์ฝํ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- suspense react-query
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- suspense ๋์์๋ฆฌ
- js
- app router emotion
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- ๊ตฌ๋ฆํค
Archives
- Today
- Total
Lennon FE
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ดํธ ๋ณํ (js) ๋ณธ๋ฌธ
728x90
๋ฐ์ํ
https://programmers.co.kr/learn/courses/30/lessons/60058?language=javascript
function solution(p) {
if(p === '')
return '';
let count = 0;
let bool = false;
let txt = "";
for(let i = 0; i < p.length; i++){
if(p[i] == '(') count++;
else count--;
if(count < 0) bool = true;
if(count === 0){
let u = p.slice(0, i+1);
let v = p.slice(i+1, p.length);
if(bool){
txt += '(';
txt += solution(v);
txt += ')';
for (let j = 1; j < i; j++) {
if (p[j] == ')') txt += '(';
if (p[j] == '(') txt += ')';
}
return txt;
}
else{
txt += u;
txt += solution(v);
return txt;
}
}
}
}
๊ฐ๋ ์นด์นด์ค ๋ฌธ์ ๋ฅผ ํ๋ค๋ณด๋ฉด ๋ฌธ์ ์์ฒด๊ฐ ์ดํด๊ฐ ์๋๋ ๊ฒฝ์ฐ๊ฐ ์๋ค.. ๋๋ง ์ดํด ๋ชปํ๋ ๊ฑด๊ฐ ํ๊ณ ์ง๋ฌธํ๊ธฐ๋ฅผ ๋ณด๋ฉด
๋ฌธ์ ์์ ์ค๋ช ํ๋ ๊ฒ ๋ช ํํ์ง ์์ ๋๋ถ๋ถ ์ดํด ๋ชปํ ์ฑ ๋ฌธ์ ํ์ดํ๋ ์ฌ๋๋ค์ด ์๋ค.
๋ฌธ์ ๋ง ์ดํดํ๋ฉด ํ๋ผ๋๋๋ก ํ๋ฉด ๋ฐ๋ก ํ ์ ์๋ ๋ฌธ์ ์ด๋ค. ์ฌ๊ท๋ก ํ๋ผ๊ณ ๋ ์๋ ค์คฌ์ผ๋ ๋ฐ๋ผ๊ฐ๊ธฐ๋ง ํ ์ ์๋ค๋ฉด
๋ค๋ค ํ ์ ์์ ๊ฒ์ด๋ค.
728x90
๋ฐ์ํ
'๐ฅ Algorithm > Programmers' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก๊ทธ๋๋จธ์ค] ์คํฌํธ๋ฆฌ (js) (0) | 2021.11.07 |
---|---|
[ํ๋ก๊ทธ๋๋จธ์ค] ์ ๊ท ์์ด๋ ์ถ์ฒ (js) (0) | 2021.11.05 |
[ํ๋ก๊ทธ๋๋จธ์ค] ๋ฌธ์์ด ์์ถ (js) (0) | 2021.11.03 |
[ํ๋ก๊ทธ๋๋จธ์ค] ์์ด ๋๋ง์๊ธฐ (js) (0) | 2021.11.02 |
[ํ๋ก๊ทธ๋๋จธ์ค] ์์ ์ต๋ํ (js) (0) | 2021.10.31 |
Comments