#K56522. Detecting Three Consecutive Patterns in a String
Detecting Three Consecutive Patterns in a String
Detecting Three Consecutive Patterns in a String
You are given a non-empty string. Your task is to check whether the string contains any of the following three patterns:
- Three consecutive identical characters (e.g. \( aaa \)).
- Three consecutive numerical digits in strictly increasing order (e.g. \( 123 \)).
- Three consecutive alphabetical characters in strictly increasing order (e.g. \( abc \)).
If at least one of these patterns exists anywhere in the string, print True
. Otherwise, print False
.
inputFormat
A single line containing a string. The string may include letters and digits.
outputFormat
Print True
if the string contains any of the specified patterns; otherwise, print False
.## sample
aaa
True