LeetCode:Add Digits(#258)youngxhui 收录于 算法 2017-09-10 约 90 字 预计阅读 1 分钟 次阅读 目录 Add Digits(#258)编号名称等级258Add DigitsEasy思路竟然还有这样的操作????😥一个非0非9的数除以9竟然就是答案,这样的规律大佬们是如何找到的?🤔代码1 2 3 4 5 class Solution { public int addDigits(int num) { return num == 0? 0: (num% 9 == 0? 9: (num%9)); } } Please enable JavaScript to view the comments powered by Valine.