← All problemsSign in

Lengthen It!

A sequence of numbers is called a good sequence if it forms an increasing consecutive sequence of integers. For eg, $[5]$, $[-3, -2, -1]$ and $[9,10,11]$ are good sequences whereas $[2,4]$, $[3,2,1]$ and $[5,7,6]$ don’t form good sequences. A subsequence of an array is the sequence obtained by removing some, possibly all number of the elements from the array. For array $A=[2,3,4,5,6]$, $[2,5,6]

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