[Swift] ํ๋ก๊ทธ๋๋จธ์ค LV.0 ์ง์๋ ์ซ์ด์
ํ๋ก๊ทธ๋๋จธ์ค LV.0 ๋ชจ์ ์ง์๋ ์ซ์ด์ ๋ฌธ์ ์ค๋ช
์ ์ n์ด ๋งค๊ฐ๋ณ์๋ก ์ฃผ์ด์ง ๋, n ์ดํ์ ํ์๊ฐ ์ค๋ฆ์ฐจ์์ผ๋ก ๋ด๊ธด ๋ฐฐ์ด์ return ํ๋๋ก solution ํจ์๋ฅผ ์์ฑํด์ฃผ์ธ์. ์ ํ ์ฌํญ 1 ≤ n ≤ 100 ์
์ถ๋ ฅ ์ n result 10 [1, 3, 5, 7, 9] 15 [1, 3, 5, 7, 9, 11, 13, 15] ์
์ถ๋ ฅ ์ ์ค๋ช
์
์ถ๋ ฅ ์ #1 10 ์ดํ์ ํ์๊ฐ ๋ด๊ธด ๋ฐฐ์ด [1, 3, 5, 7, 9]๋ฅผ returnํฉ๋๋ค. ์
์ถ๋ ฅ ์ #2 15 ์ดํ์ ํ์๊ฐ ๋ด๊ธด ๋ฐฐ์ด [1, 3, 5, 7, 9, 11, 13, 15]๋ฅผ return ํฉ๋๋ค. ์ ์ถ import Foundation func solution(_ n:Int) -> [Int] { var answer = [Int]() for i..
2022. 11. 30.