Let's consider an example where there are limitations on the length of substrings. Assume that the substrings must be either 2 or 3 characters long. Here’s how to tackle this issue: def string_split_count_restriction(string): n = len(string) dp = [0]*(n+1) dp[0] = dp[1] = 1 for i in range(2, n+1): dp[i] = dp[i-1] + (dp[i-2] if i>2 else 0) + (dp[i-3] if i>3 else 0) return dp[n] In this scenario, we apply Dynamic Programming to address the problem. The concept is to create a DP array where dp[i] indicates the number of ways to partition a string of length i . We start by setting dp[0] and dp[1] to 1, since there is only one way to partition strings of lengths 0 or 1. From i=2 onwards, we accumulate the DP values from the previous one, two, and three indices (if they exist), as substrings can be of lengths 2 or 3. Ultimately, dp[n] provides the total number of ways to split the input string, considering the constraints on substring length.