title: find kth good number
body: <p>Recently, In a competitive coding exam I got this question -</p>
  <p>A good number is number whose sum of digits is divisible by 5. example - 5 (5), 14 (1+4), 19(1+9), 23(2+3)</p>
  <p>Question is - you are provided a integer <code>n</code> and another integer <code>k</code> you have to find kth good number greater the  n.</p>
  <p>Constraints - <code>1&lt;k&lt;10^9</code></p>
  <p>Sample test 1 -</p>
  <pre><code>input: n = 6, k = 5
  output: 32
  Explanation: After 6 good numbers are  - 14, 19, 23, 28, 32 (5th is 32)
  </code></pre>
  <p>Sample test 2 -</p>
  <pre><code>input: n = 5, k = 1
  output: 14
  Explanation: 5 is 1st good number but we need greater than 5 so ans is 14
  </code></pre>
  <p>I have tried it with native approach i.e for each number greater then n checking if it is good and loop until I found k good numbers, here is my code -</p>
  <pre><code>def solve(n,k):
      n+=1
      count = 0
      while count&lt;k:
          if sum(map(int,str(n)))%5==0:
              count+=1
          n+=1
      return n-1
  </code></pre>
  <p>but above code was gave me TLE, how to do it in better time complexity, I have searched on internet for similar question but unable to find, help.</p>