์ด์ฌํ2 [CK] 2021 ์นด์นด์ค ์ฑ์ฉ์ฐ๊ณํ ์ธํด์ญ > ์ซ์ ๋ฌธ์์ด๊ณผ ์๋จ์ด ๋ฌธ์ ์ค๋ช ๋ค์ค์ ํ๋ก๋๊ฐ ์ซ์๋์ด๋ฅผ ํ๊ณ ์์ต๋๋ค. ๋ค์ค๊ฐ ํ๋ก๋์๊ฒ ์ซ์๋ฅผ ๊ฑด๋ฌ ๋ ์ผ๋ถ ์๋ฆฟ์๋ฅผ ์๋จ์ด๋ก ๋ฐ๊พผ ์นด๋๋ฅผ ๊ฑด๋ค์ฃผ๋ฉด ํ๋ก๋๋ ์๋ ์ซ์๋ฅผ ์ฐพ๋ ๊ฒ์์ ๋๋ค. ๋ค์์ ์ซ์์ ์ผ๋ถ ์๋ฆฟ์๋ฅผ ์๋จ์ด๋ก ๋ฐ๊พธ๋ ์์์ ๋๋ค. 1478 โ "one4seveneight" 234567 โ "23four5six7" 10203 โ "1zerotwozero3" ์ด๋ ๊ฒ ์ซ์์ ์ผ๋ถ ์๋ฆฟ์๊ฐ ์๋จ์ด๋ก ๋ฐ๋์ด์ก๊ฑฐ๋, ํน์ ๋ฐ๋์ง ์๊ณ ๊ทธ๋๋ก์ธ ๋ฌธ์์ด s๊ฐ ๋งค๊ฐ๋ณ์๋ก ์ฃผ์ด์ง๋๋ค. s๊ฐ ์๋ฏธํ๋ ์๋ ์ซ์๋ฅผ return ํ๋๋ก solution ํจ์๋ฅผ ์์ฑํด์ฃผ์ธ์. ์ฐธ๊ณ ๋ก ๊ฐ ์ซ์์ ๋์๋๋ ์๋จ์ด๋ ๋ค์ ํ์ ๊ฐ์ต๋๋ค. ์ซ์ ์๋จ์ด 0 zero 1 one 2 two 3 three 4 four 5 five 6 six 7 .. CodeKata/Programmers 2021. 11. 19. 0 [CK] Sum of Digits / Digital Root Digital root is the recursive sum of all the digits in a number. Given n, take the sum of the digits of n. If that value has more than one digit, continue reducing in this way until a single-digit number is produced. The input will be a non-negative integer. Examples 16 --> 1 + 6 = 7 942 --> 9 + 4 + 2 = 15 --> 1 + 5 = 6 132189 --> 1 + 3 + 2 + 1 + 8 + 9 = 24 --> 2 + 4 = 6 493193 --> 4 + 9 + 3 + 1.. CodeKata/Codewars 2021. 10. 19. 0 ์ด์ 1 ๋ค์