Here you have to count the maximum number of consecutive zero and one. Suppose a is the maximum consecutive number of one & b is the maximum consecutive number of zero.
If a is greater then or equal P or b is greater than or equal Q then print he is in danger else he is safe.

Statistics

89% Solution Ratio
aritra741Earliest, Oct '20
aritra741Fastest, 0.0s
EgorKulikovLightest, 0 B
bokaifShortest, 118B
Toph uses cookies. By continuing you agree to our Cookie Policy.