๐ŸŽ„[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] ๋ชจ์Œ ์ œ๊ฑฐ

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

Programmers

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

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

์˜์–ด์—์„  a, e, i, o, u ๋‹ค์„ฏ ๊ฐ€์ง€ ์•ŒํŒŒ๋ฒณ์„ ๋ชจ์Œ์œผ๋กœ ๋ถ„๋ฅ˜ํ•ฉ๋‹ˆ๋‹ค. ๋ฌธ์ž์—ด my_string์ด ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ฃผ์–ด์งˆ ๋•Œ ๋ชจ์Œ์„ ์ œ๊ฑฐํ•œ ๋ฌธ์ž์—ด์„ returnํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด์ฃผ์„ธ์š”.


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

  • my_string์€ ์†Œ๋ฌธ์ž์™€ ๊ณต๋ฐฑ์œผ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ์Šต๋‹ˆ๋‹ค.
  • 1 โ‰ค my_string์˜ ๊ธธ์ด โ‰ค 1,000

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

my_stringresult
"bus""bs"
"nice to meet you""nc t mt y"

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

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

  • "bus"์—์„œ ๋ชจ์Œ u๋ฅผ ์ œ๊ฑฐํ•œ "bs"๋ฅผ returnํ•ฉ๋‹ˆ๋‹ค.

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

  • "nice to meet you"์—์„œ ๋ชจ์Œ i, o, e, u๋ฅผ ๋ชจ๋‘ ์ œ๊ฑฐํ•œ "nc t mt y"๋ฅผ returnํ•ฉ๋‹ˆ๋‹ค.

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

const solution = my_string => [...my_string].filter(a => ['a','e','i','o','u'].includes(a) ? false : true).join("")
profile
๋‚ด ์ง€์‹์„ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ๋Š” ๋Œ€๋‹ดํ•จ

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