#K33922. Consecutive Segment Check
Consecutive Segment Check
Consecutive Segment Check
Given a street represented as a string s containing only the characters 'T', 'L', 'H', and '.', determine whether there exists a contiguous segment of exactly three characters that contains all of the items 'T', 'L', and 'H' without any interruptions (i.e. without any '.' in between).
In other words, find if there exists an index i such that the substring \( s[i:i+3]\ \) satisfies:
\[ \{T, L, H\} \subseteq \{s[i], s[i+1], s[i+2]\} \quad \text{and} \quad '.' \notin \{s[i], s[i+1], s[i+2]\} \]If such a segment exists, output "Yes"; otherwise, output "No".
inputFormat
The input contains a single line with a string s (1 ≤ |s| ≤ 105), which is composed only of the characters 'T', 'L', 'H', and '.'.
outputFormat
Output a single line with the result: "Yes" if there exists a consecutive segment of three characters containing 'T', 'L', and 'H' (with no '.' present in those three characters), or "No" otherwise.
## sampleTLH.TLHTH
Yes