๋ชฉ๋ก๋ฌธ์ž์—ด ์„ž๊ธฐ (1)

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

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

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