๋ชฉ๋ก๋ฌธ์ž์—ด๊ณฑํ•˜๊ธฐ (1)

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

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค:Javascript] ๋ฌธ์ž์—ด ๊ณฑํ•˜๊ธฐ

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค Lv.0 - ๋ฌธ์ž์—ด ๊ณฑํ•˜๊ธฐ ๐Ÿ’š ๋ฌธ์ œ์„ค๋ช… ๋ฌธ์ž์—ด my_string๊ณผ ์ •์ˆ˜ k๊ฐ€ ์ฃผ์–ด์งˆ ๋•Œ, my_string์„ k๋ฒˆ ๋ฐ˜๋ณตํ•œ ๋ฌธ์ž์—ด์„ return ํ•˜๋Š” solution ํ•จ์ˆ˜๋ฅผ ์ž‘์„ฑํ•ด ์ฃผ์„ธ์š”. ๐Ÿ’š ์ œํ•œ์กฐ๊ฑด 1 ≤ my_string์˜ ๊ธธ์ด ≤ 100 my_string์€ ์˜์†Œ๋ฌธ์ž๋กœ๋งŒ ์ด๋ฃจ์–ด์ ธ ์žˆ์Šต๋‹ˆ๋‹ค. 1 ≤ k ≤ 100 ๐Ÿ’š ํ’€์ด function solution(my_string, k) { return my_string.repeat(k) } โœ… ์ €๋ฒˆ์— ๋ฌธ์ž์—ด ๋ฐ˜๋ณต์ถœ๋ ฅํ•˜๋Š” ๋ฌธ์ œ์—์„œ ์‚ฌ์šฉํ•œ repeat() ๋ฉ”์„œ๋“œ ์‚ฌ์šฉํ•ด์•ผ๊ฒ ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ๋‹ค. ๐Ÿ’ก repeat() ๋ฉ”์„œ๋“œ๋Š” ๋ฌธ์ž์—ด์„ ์ฃผ์–ด์ง„ ํšŸ์ˆ˜๋งŒํผ ๋ฐ˜๋ณตํ•ด ๋ถ™์ธ ์ƒˆ๋กœ์šด ๋ฌธ์ž์—ด์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. str.repeat(count); count => ๋ฌธ์ž์—ด์„ ๋ฐ˜๋ณตํ•  ํšŸ์ˆ˜...