#P11198. Check for Three Consecutive 'o's
Check for Three Consecutive 'o's
Check for Three Consecutive 'o's
You are given a string S of length N, where each character of S is either o
or x
.
Your task is to determine whether S contains three consecutive o
characters.
The condition can be mathematically expressed as checking if there exists an index \( i \) such that:
\[ S_i = S_{i+1} = S_{i+2} = o \]If such an index exists, print Yes
, otherwise print No
.
inputFormat
The input consists of a single line containing the string S.
Note: S contains only the characters o
and x
.
outputFormat
Output Yes
if the string S contains three consecutive o
characters, otherwise output No
.
sample
oxoxo
No