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
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- suspense ๋น๋๊ธฐ
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- ์ต์ ๋์ฒด์ด๋
- ๋ฐฑ์ค 1339๋ฒ nodejs
- emtion app router
- suspense react-query
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- app router emotion
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- next13 emotion
- ์นด์นด์ค ์ฝํ
- js
- suspense ๋ณ๋ชฉํ์
- js ์ค์ฝํ
- ๋ฐฑ์ค 1339๋ฒ js
- ๋ฐฑ์ค 2108 nodejs
- emotion RSC
- ์ค์ฝํ
- suspense ๋์์๋ฆฌ
- ๊ตฌ๋ฆํค
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- 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
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ธฐ๋ฅ ๊ฐ๋ฐ (js) ๋ณธ๋ฌธ
728x90
๋ฐ์ํ
https://programmers.co.kr/learn/courses/30/lessons/42586?language=javascript
function solution(progresses, speeds) {
const days = progresses.map((v,i) => Math.ceil((100 - progresses[i]) / speeds[i]))
const answer = [];
for(let i = 0; i < days.length; i++){
const result = [days[i]];
for(let j = i+1; j < days.length; j++){
if(days[i] >= days[j]) result.push(days[j]);
else break;
}
answer.push(result);
i += result.length-1;
}
return answer.map((a) => a.length);
}
์คํ๊ณผ ํ๋ฅผ ์ด์ฉํด ํธ๋ ๋ฌธ์ ์๋ค.
shift๋ฅผ ์ด์ฉํด ํ์ด๋ดค์ง๋ง ์๋๊ฐ ๋๋ ค ๊ทธ๋ฅ for๋ฌธ์ผ๋ก ์ธ๋ฑ์ค ๊ฐ์ ์กฐ์ ํ์ฌ ์์ฑํ์๋ค.
728x90
๋ฐ์ํ
'๐ฅ Algorithm > Programmers' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก๊ทธ๋๋จธ์ค] ๋ฒ ์คํธ์จ๋ฒ (js) (0) | 2021.10.26 |
---|---|
[ํ๋ก๊ทธ๋๋จธ์ค] ๊ฐ์ฅ ํฐ ์ (js) (0) | 2021.10.25 |
[ํ๋ก๊ทธ๋๋จธ์ค] ํฌ๋ ์ธ ์ธํ๋ฝ๊ธฐ (javascript) (0) | 2021.10.20 |
[ํ๋ก๊ทธ๋๋จธ์ค] 1์ฐจ ์บ์ (javaScript) (0) | 2021.10.07 |
[ํ๋ก๊ทธ๋๋จธ์ค] ํ๋ ์ฆ 4๋ธ๋ก (javascript) (0) | 2021.09.25 |
Comments