#C11367. Productivity Day Checker
Productivity Day Checker
Productivity Day Checker
You are given a sequence of daily activities represented by a string (t) and an integer (m) which denotes the maximum number of consecutive work activities allowed. Each character in (t) is either a work activity ('W') or a rest activity ('R'). A day is called productive if there is no contiguous block of work activities that exceeds (m). For example, if (t = "WWRWRW") and (m = 2), the day is productive because no more than 2 consecutive 'W's occur. However, if (t = "WWW") with (m = 2), the day is not productive because there is a block of 3 consecutive work activities. Your task is to check whether the given day meets the productivity guidelines.
inputFormat
The input is read from standard input (stdin). The first line contains a non-empty string (t) representing the sequence of activities. The second line contains an integer (m) representing the maximum allowed consecutive work ('W') activities.
outputFormat
Output a single line to standard output (stdout) containing either 'True' if the day is productive, or 'False' if it is not.## sample
WWRWRW
2
True