Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use dynamic programming. Build an array dp where dp[i] is the number of ways you can divide the string starting from index i to the end.
Keep in mind that the answer is modulo 10^9 + 7 and take the mod for each operation.