Last updated 5 years ago
Was this helpful?
这其实算数学题,有现成的公式可以用。
public class Solution { public int addDigits(int num) { return 1 + (num - 1) % 9; } }