2019 ์นด์นด์ค ๊ฐ๋ฐ์ ๊ฒจ์ธ ์ธํด์ฝ ํํ Swift
๋ฌธ์ ์ฐธ๊ณ ์ฝ๋ฉํ
์คํธ ์ฐ์ต - ํํ "{{2},{2,1},{2,1,3},{2,1,3,4}}" [2, 1, 3, 4] "{{1,2,3},{2,1},{1,2,4,3},{2}}" [2, 1, 3, 4] "{{4,2,3},{3},{2,3,4,1},{2,3}}" [3, 2, 4, 1] programmers.co.kr Foma์ ํ์ด ์ฃผ์ด์ง s๋ {{}} let count = s.filter{$0 == "{"}.count {...}๋ฅผ ๋ฐฐ์ด๋ก ๋ฐ๊พธ์ด ๋ด์์ค ๋ณ์๋ ๋ง๋ค์ด์ค๋๋ค.(count-1๋งํผ ํฌ๊ธฐ๋ฅผ ์ ํด์ค๋๋ค.) => var numbersArray = Array(repeating: [Int](), count: count-1) ๋ฐฉ๋ฒ์ ๋จผ์ s์์ "{"๋ฅผ ์ ๊ฑฐํด์ค๋๋ค. ex) "{{2},{2,1},{2,1,3},{..
2020. 9. 7.