Melisandre and her Vision
CodeChefOpen on judge ↗
Melisandre is again looking to the future in the fire with help of The Lord. A series of events starts coming in her vision. The series of events is in the form of a string $S$, in which each event is represented as a digit ranging from '0' to '9'. Now, when she had already seen $N$ number of events(i.e. $N$ digits), she gets interrupted by Jon Snow. Now, she wants to see all this again, but this
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.
Sign in to chat with the tutor and save your progress.
Sign in to start