UP & DOWN SEQUENCES
CodeChefOpen on judge ↗
In a given sequence of N integers [a1,a2,....,a n ], all the elements in a strictly increasing order to the left of the maximum value of the input sequence are said to be the "up part", and those in a strictly descending order to the right of the maximum value, are said to be the "down part". Subsequences consisting of both the parts are called "UP & DOWN sequences". Note that the maximum value m
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