1416. Restore The Array
https://leetcode.com/problems/restore-the-array
Description
A program was supposed to print an array of integers. The program forgot to print whitespaces and the array is printed as a string of digits s
and all we know is that all integers in the array were in the range [1, k]
and there are no leading zeros in the array.
Given the string s
and the integer k
, return the number of the possible arrays that can be printed as s
using the mentioned program. Since the answer may be very large, return it modulo 109 + 7
.
Example 1:
Example 2:
Example 3:
Example 4:
Example 5:
Constraints:
1 <= s.length <= 105
s
consists of only digits and does not contain leading zeros.1 <= k <= 109
ac
Previous1415. The k-th Lexicographical String of All Happy Strings of Length nNext1417. Reformat The String
Last updated