@@ -0,0 +1,644 @@
+/**%0A * Author : Laberat%0A * Date   : 16/2/2.%0A * Link   : https://leetcode.com/problems/add-digits/%0A * Number : # 258%0A * Desc   : Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.%0A *          Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it.%0A *          Could you do it without any loop/recursion in O(1) runtime?%0A *%0A * Refer  : https://en.wikipedia.org/wiki/Congruence_relation%0A */%0Apublic class AddDigits %7B%0A    public int addDigits(int num) %7B%0A        if (num %3C= 9) return num;%0A        if (num %25 9 != 0) return num %25 9;%0A        return 9;%0A    %7D%0A%7D%0A

solve #258