Company: Trimble
Difficulty: medium
Debugging - K-special numbers Problem Description You are given a code for the following problem statement in the count_K_special_numbers function. However, the solution fails the test cases because there are bugs in the code. Your task is to find and fix all the bugs so that it passes all the test cases. You are given a range [L, R] and an integer k . An integer A as a_1 a_2 ... a_n consisting of n digits in decimal representation without any leading zeros is called K-special number, if (a_i mod k) = (i mod k) holds true for all i (1 ≤ i ≤ n) . Task: Determine the number of K-special numbers in the range [L, R] . Notes: The mod operation returns the remainder or signed remainder of a division after dividing one number by another. It is represented by the % sign in Python. 1-based indexing is followed. Complete the count_K_special_numbers function provided in the editor. This function takes the following 3 parameters and returns the number of K-Special numbers in the range [L, R]