← All problemsSign in

New Sequence

Sandu, a teacher in Chefland introduced his students to a new sequence i.e. 0,1,0,1,2,0,1,2,3,0,1,2,3,4........ The Sequence starts from 0 and increases by one till $i$(initially i equals to 1), then repeat itself with $i$ changed to $i+1$ Students being curious about the sequence asks the Nth element of the sequence. Help Sandu to answer the Students Input: - The first-line will contain $T$,

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