2269. Find the K-Beauty of a Number
Easy
The k-beauty of an integer num
is defined as the number of substrings of num
when it is read as a string that meet the following conditions:
It has a length of
k
.It is a divisor of
num
.
Given integers num
and k
, return the k-beauty of num
.
Note:
Leading zeros are allowed.
0
is not a divisor of any value.
A substring is a contiguous sequence of characters in a string.
Example 1:
Example 2:
Constraints:
1 <= num <= 109
1 <= k <= num.length
(takingnum
as a string)
解題
Previous2265. Count Nodes Equal to Average of Subtree ⭐Next2273. Find Resultant Array After Removing Anagrams
Last updated