Pikachu
InterviewTime limit2sMemory limit512 MB
Decide whether a given lowercase string can be split into a sequence of the tokens "pi", "ka", and "chu".
- Level
Easy3 of 10
- Topics
- String, Greedy, Implementation
- Solved
- No attempts yet
Problem
Pikachu can pronounce "pi", "ka", and "chu". So Pikachu can pronounce only words made by joining these three syllables. For example, Pikachu can pronounce "pikapi" and "pikachu".
Given a string , write a program that determines whether Pikachu can pronounce it.
Input
The first line contains the string . consists only of lowercase English letters, and its length is at most 5000.
Output
Print YES if can be formed by concatenating "pi", "ka", and "chu", and NO otherwise.