๋ชฉ๋ก์‹œ์ €์•”ํ˜ธ (1)

Focus On Develop ๐ŸคŸ๐ŸคŸ

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค] ์‹œ์ € ์•”ํ˜ธ

์ผ๋‹จ ์•ŒํŒŒ๋ฒณ ๋Œ€์†Œ๋ฌธ์ž๋Š” ASCII์ฝ”๋“œ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์–ด์„œ, s๋ฅผ ๋Œ€/์†Œ๋ฌธ์ž ๋ฒ”์œ„์— ๋”ฐ๋ผ ์ฒดํฌํ•˜๋Š” ๊ฒƒ๋„ ํ•˜๋‚˜์˜ ๋ฐฉ๋ฒ•์ผ ๋“ฏ ํ•œ๋ฐ.. (๋‚˜๋Š” ASCII์ฝ”๋“œ๋ฅผ ์‚ฌ์‹ค ์ž˜ ๋ชจ๋ฆ„ ใ…‹) ์•ŒํŒŒ๋ฒณ ์ˆœ์„œ๋Š” ์–ด์ฐจํ”ผ ์•Œ๊ณ  ์žˆ๋Š” ๊ฑฐ๋‹ˆ๊นŒ ์ฐจ๋ผ๋ฆฌ ์•ŒํŒŒ๋ฒณ์„ ๋ฏธ๋ฆฌ ์ •์˜ํ•ด๋†“๊ณ , s์˜ ๋ฌธ์ž๋“ค์„ ์ฒดํฌํ•˜๋ฉด์„œ ์ •์˜ํ•ด๋‘” ์•ŒํŒŒ๋ฒณ ๋ฌธ์ž์—์„œ n๋งŒํผ ๋’ค์— ์žˆ๋Š” ๋ฌธ์ž๋กœ ๋Œ€์ฒดํ•˜๋Š” ๊ฑธ๋กœ ํ’€์–ด์•ผ๊ฒ ๋‹ค. z๋ฅผ ๋„˜์–ด๊ฐ€๋ฉด Out of Index๋‹ˆ๊นŒ.. ์›ํ˜•๋ฐฐ์—ด์ฒ˜๋Ÿผ % ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•ด์„œ Index๋ฅผ ์ฐพ์•„์•ผ๊ฒ ๋‹ค. let alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" let lowerAlpha = alpha.lowercased() let arrayAlpha = Array(alpha) let arrayLowerAlpha = Array(lowerAlpha) f..