nowyes
@nowyes
Reviews Written
1
Average Rating
5.0
The introduction is empty
Posts
Q&A
reduce๋ฐฉ์์ ํ์ด๋ดค์ต๋๋ค.
function solution2(input){ let answer = 0; if(input[0] === 1) answer += 1; input.reduce((acc, cur) => { if(cur === 1) { acc += cur answer += acc; } else acc = 0; return acc; }) return answer; } ์ ๋ ๋น์ทํ์๋ค์!
- Likes
- 2
- Comments
- 2
- Viewcount
- 288
Q&A
switch๋ฌธ์ ์ฌ์ฉํด ํ์ด๋ดค์ต๋๋ค
์ ๋ switch๋ฌธ ํ๋ผ๋ฏธํฐ์ a[i] - b[i]๋ฅผ ๋ฃ์ด์ ํ์๋๋ ์ฝ๋๊ฐ ๊ฐ๋จํด์ก์ด์!
- Likes
- 0
- Comments
- 2
- Viewcount
- 374




