← All problemsSign in

Chef and Uniqueness

CodeChefRating 2871Open on judge ↗

Today chef has decided to cook a string S of length N. But he will not just cook the whole string, but a unique substring of the given string S. A substring is unique if it occurs in the string S only once. Chef also does not like all the indices of a string. He wants a special index i to be in the unique substring. But the length of the unique substring should be minimized. Chef wants your help

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