Three Consecutive
Time limit2sMemory limit1024 MB
Given a string of 'o' and 'x' characters, the task is to check whether three 'o' characters appear consecutively.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
A string S of length N is given. Each character of S is either o or x.
Print Yes on one line if S has three o characters in a row. Otherwise, print No.
An o may be adjacent to a run of three o characters.
Input
The input is given in the following format.
N
S
Output
Print Yes if S contains three o characters in a row. Otherwise, print No.
Constraints
1 ≦ N ≦ 100 000.Sis a string of lengthN.- Each character of
Sisoorx. Nis an integer.