๋ชฉ๋ก5๋ช…์”ฉ (1)

๐Ÿค ์€์ง€log ๐Ÿค

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค:Javascript] 5๋ช…์”ฉ

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค Lv.0 - 5๋ช…์”ฉ ๐Ÿ’š ๋ฌธ์ œ์„ค๋ช… ์ตœ๋Œ€ 5๋ช…์”ฉ ํƒ‘์Šน๊ฐ€๋Šฅํ•œ ๋†€์ด๊ธฐ๊ตฌ๋ฅผ ํƒ€๊ธฐ ์œ„ํ•ด ์ค„์„ ์„œ์žˆ๋Š” ์‚ฌ๋žŒ๋“ค์˜ ์ด๋ฆ„์ด ๋‹ด๊ธด ๋ฌธ์ž์—ด ๋ฆฌ์ŠคํŠธ names๊ฐ€ ์ฃผ์–ด์งˆ ๋•Œ, ์•ž์—์„œ ๋ถ€ํ„ฐ 5๋ช…์”ฉ ๋ฌถ์€ ๊ทธ๋ฃน์˜ ๊ฐ€์žฅ ์•ž์— ์„œ์žˆ๋Š” ์‚ฌ๋žŒ๋“ค์˜ ์ด๋ฆ„์„ ๋‹ด์€ ๋ฆฌ์ŠคํŠธ๋ฅผ returnํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด์ฃผ์„ธ์š”. ๋งˆ์ง€๋ง‰ ๊ทธ๋ฃน์ด 5๋ช…์ด ๋˜์ง€ ์•Š๋”๋ผ๋„ ๊ฐ€์žฅ ์•ž์— ์žˆ๋Š” ์‚ฌ๋žŒ์˜ ์ด๋ฆ„์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ’š ์ œํ•œ์กฐ๊ฑด 5 ≤ names์˜ ๊ธธ์ด ≤ 30 1 ≤ names์˜ ์›์†Œ์˜ ๊ธธ์ด ≤ 10 names์˜ ์›์†Œ๋Š” ์˜์–ด ์•ŒํŒŒ๋ฒณ ์†Œ๋ฌธ์ž๋กœ๋งŒ ์ด๋ฃจ์–ด์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ’š ํ’€์ด function solution(names) { const answer = []; for ( let i = 0; i < names.length; i+= 5) { answer.p..