2269. Find the K-Beauty of a Number
On This Page
class Solution:
def divisorSubstrings(self, num: int, k: int) -> int:
res = 0
s = str(num)
for i in range(len(s) - k + 1):
t = int(s[i : i + k])
if t and num % t == 0:
res += 1
return res