๋ชฉ๋ก์ˆ˜์กฐ์ž‘ํ•˜๊ธฐ1 (1)

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

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค:Javascript] ์ˆ˜ ์กฐ์ž‘ํ•˜๊ธฐ 1

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค Lv.0 - ์ˆ˜ ์กฐ์ž‘ํ•˜๊ธฐ 1 ๐Ÿ’š ๋ฌธ์ œ์„ค๋ช… ์ •์ˆ˜ n๊ณผ ๋ฌธ์ž์—ด control์ด ์ฃผ์–ด์ง‘๋‹ˆ๋‹ค. control์€ "w", "a", "s", "d"์˜ 4๊ฐœ์˜ ๋ฌธ์ž๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ์œผ๋ฉฐ, control์˜ ์•ž์—์„œ๋ถ€ํ„ฐ ์ˆœ์„œ๋Œ€๋กœ ๋ฌธ์ž์— ๋”ฐ๋ผ n์˜ ๊ฐ’์„ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค. "w" : n์ด 1 ์ปค์ง‘๋‹ˆ๋‹ค. "s" : n์ด 1 ์ž‘์•„์ง‘๋‹ˆ๋‹ค. "d" : n์ด 10 ์ปค์ง‘๋‹ˆ๋‹ค. "a" : n์ด 10 ์ž‘์•„์ง‘๋‹ˆ๋‹ค. ์œ„ ๊ทœ์น™์— ๋”ฐ๋ผ n์„ ๋ฐ”๊ฟจ์„ ๋•Œ ๊ฐ€์žฅ ๋งˆ์ง€๋ง‰์— ๋‚˜์˜ค๋Š” n์˜ ๊ฐ’์„ return ํ•˜๋Š” solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด ์ฃผ์„ธ์š”. ๐Ÿ’š ์ œํ•œ์กฐ๊ฑด -100,000 ≤ n ≤ 100,000 1 ≤ control์˜ ๊ธธ์ด ≤ 100,000 control์€ ์•ŒํŒŒ๋ฒณ ์†Œ๋ฌธ์ž "w", "a", "s", "d"๋กœ ์ด๋ฃจ์–ด์ง„ ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค. ๐Ÿ’š ํ’€์ด funct..