2310. Sum of Numbers With Units Digit K
Given two integers num and k, consider a set of positive integers with the following properties:
- The units digit of each integer is k.
- The sum of the integers is num.
Return the minimum possible size of such a set, or -1 if no such set exists.
Note:
- The set can contain multiple instances of the same integer, and the sum of an empty set is considered 0.
- The units digit of a number is the rightmost digit of the number.
1 | class Solution { |