LeetCode solutions by tgic

Add Digits

https://leetcode.com/problems/add-digits

Last Update 2015-08-16 16:35:59 +0000 View on Github

Source code Read on Github

1 public class Solution {
2     public int addDigits(int num) {
3         return num - (num - 1) / 9 * 9;
4     }
5 }
comments powered by Disqus

LeetCode solutions by tgic

  • LeetCode solutions by tgic
  • [email protected]
  • Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
  • tg123
  • tg123/leetcode

LeetCode java solutions by tgic