Jammy got the prescription of medicine. Every medicine is k characters long, But on the preseniption the medicine names are written as single string...............[See readme file]
Full Question:- Jammy got the prescription of medicine. Every medicine is k characters long, But on the preseniption the medicine names are written as single string. Take this single string of medicine names and value k as input from the user, and divide the string into subparts to retain the individual medicine names in the following way:
-
The total number of subparts representing individual medicine names are the division of length of string and k i len(string) / k and (length of string > k),
-
Remove the occurrence of character which is more than one, from each subpart
-
The character in each subpart is in the same sequence as in the original medicine name.
Note: If len(string)%k is not equal to 0 then print “Invalid”
Constraint:
1 <= k < length of the input string.