๐Ÿš„[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] ๋ฐฐ์—ด ์›์†Œ์˜ ๊ธธ์ด

Chobbyยท2022๋…„ 10์›” 11์ผ
1

Programmers

๋ชฉ๋ก ๋ณด๊ธฐ
75/349

๐Ÿงก๋ฌธ์ œ ์„ค๋ช…

๋ฌธ์ž์—ด ๋ฐฐ์—ด strlist๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค. strlist ๊ฐ ์›์†Œ์˜ ๊ธธ์ด๋ฅผ ๋‹ด์€ ๋ฐฐ์—ด์„ retrunํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด์ฃผ์„ธ์š”.


๐Ÿ’›์ œํ•œ์‚ฌํ•ญ

  • 1 โ‰ค strlist ์›์†Œ์˜ ๊ธธ์ด โ‰ค 100
  • strlist๋Š” ์•ŒํŒŒ๋ฒณ ์†Œ๋ฌธ์ž, ๋Œ€๋ฌธ์ž, ํŠน์ˆ˜๋ฌธ์ž๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ’š ์ž…์ถœ๋ ฅ ์˜ˆ

strlistresult
["We", "are", "the", "world!"][2, 3, 3, 6]
["I", "Love", "Programmers."][1, 4, 12]

๐Ÿ’™์ž…์ถœ๋ ฅ ์˜ˆ ์„ค๋ช…

์ž…์ถœ๋ ฅ ์˜ˆ #1

  • ["We", "are", "the", "world!"]์˜ ๊ฐ ์›์†Œ์˜ ๊ธธ์ด์ธ [2, 3, 3, 6]์„ returnํ•ฉ๋‹ˆ๋‹ค.

์ž…์ถœ๋ ฅ ์˜ˆ #2

  • ["I", "Love", "Programmers."]์˜ ๊ฐ ์›์†Œ์˜ ๊ธธ์ด์ธ [1, 4, 12]์„ returnํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ’œ๋‚˜์˜ ํ’€์ด

const solution = strlist => strlist.map(a => a.length)
profile
๋‚ด ์ง€์‹์„ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ๋Š” ๋Œ€๋‹ดํ•จ

0๊ฐœ์˜ ๋Œ“๊ธ€