package leetcode.add_digits;

public class Solution {
    public int addDigits(int num) {
        if(num == 0) return 0;
        return 9 - (9 - (num % 9)) % 9;
    }
}

Add java solution for 258. Add Digits
Add java solution for 258. Add Digits

258. Add Digits: https://leetcode.com/problems/add-digits/