Question: You are given a string S of length N . The string S consists of only lowercase English letters ( a , b , c
You are given a string S of length N The string S consists of only lowercase English letters a b c You are also given an array A of size You have to partition the given string into exactly K parts. A partition is called good if it holds the following conditions
String S should be partitioned into exactly K contiguous substrings, No substrings can be empty. Each partition should contain a maximum A number of occurrences of a A number of occurrences of so on A occurrences of z
For example, consider string "aab", and A A and K a ab is a good partition but aa I b is not a good partition
You are required to count the number of the good partition of string S Sincethe number of aood partitions can be verv larae. print modulo
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
