add algorithm to find min sum of digits