1977. Number of Ways to Separate Numbers
https://leetcode.com/problems/number-of-ways-to-separate-numbers
Description
You wrote down many positive integers in a string called num
. However, you realized that you forgot to add commas to seperate the different numbers. You remember that the list of integers was non-decreasing and that no integer had leading zeros.
Return the number of possible lists of integers that you could have written down to get the string num
. Since the answer may be large, return it modulo 109 + 7
.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
1 <= num.length <= 3500
num
consists of digits'0'
through'9'
.
ac
Previous1976. Number of Ways to Arrive at DestinationNext1978. Employees Whose Manager Left the Company
Last updated