Company: Linkedin_31aug
Difficulty: medium
Count Integers with Divisible Digit Sum Problem Description Find the number of positive integers less than or equal to k such that the sum of their digits is divisible by m . Since the answer can be large, report it modulo (10 9 + 7). Function Description Complete the function countIntegers in the editor with the following parameters: long k : test the range from 1 through k int m : the target sum Returns int : the count of numbers that are less than or equal to k such that their sum of the digits is divisible by m , modulo (10 9 + 7) Examples Example 1: Input: k = 30, m = 4 Explanation: The numbers less than or equal to 30 with a sum of digits divisible by 4 are: 4 (sum = 4) 8 (sum = 8) 13 (sum = 1+3 = 4) 17 (sum = 1+7 = 8) 22 (sum = 2+2 = 4) 26 (sum = 2+6 = 8) Output: 6 (6 modulo (10^9 + 7) = 6) Example 2: Input: k = 20, m = 5 Output: 3 Explanation: The values in the range whose sum of digits is divisible by 5 are 5, 14, and 19. Example 3: Input: k = 10, m = 2 Output: 4 Explanation: