← All problemsSign in

Favourite String of Chef

CodeChefRating 1284Open on judge ↗

A string $S$ is called *Chef's favourite* if every substring `chef` in $S$ must have a substring `code` before it. You are given a string $S$ of size $N$ that contains both `code` and `chef` as a substring. Please determine if $S$ is Chef's favourite. **Note**: A substring is a continuous part of string which can be obtained by deleting some (may be none) character's from the beginning and some

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start