← All problemsSign in

Chef and The String of Digits

CodeChefRating 2733Open on judge ↗

The Chef has written all the numbers from 1 to 109 consecutively on a board. Let P be the long string obtained by concatenating the numbers written on the board consecutively. Given below are the first few digits of the long string P. 12345678910111213141516171819202122232425262728293031323334353637383940.... Given another string Q, he is wondering whether Q is a substring of the string P. For e

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