#K56277. Consecutive Successful Weeks
Consecutive Successful Weeks
Consecutive Successful Weeks
In this challenge, you are provided with the weekly attendance records of a team. Each week is represented as a string consisting of the characters (A) (present) and (N) (absent). A week is considered successful if at least one team member is present, i.e. the week string contains at least one (A). Your task is to determine the maximum number of consecutive successful weeks. Note that the first line of input contains two integers: the number of team members and the number of weeks, followed by the attendance record for each week.
inputFormat
The input begins with two integers (m) and (w) separated by a space, where (m) is the number of team members and (w) is the number of weeks. This is followed by (w) lines, each line containing a string of length (m) composed only of the characters (A) and (N), representing that week's attendance record.
outputFormat
A single integer denoting the maximum number of consecutive successful weeks.## sample
3 3
AAN
NAA
AAN
3