Mountain Array
CodeChefOpen on judge ↗
OJ loves playing with arrays. One day he came across one array which he named as ‘mountain array’. A ‘mountain array’ is an array in which all the elements are pairwise distinct, the array size is odd (consider size as k) and first ⌊k/2⌋ elements in array are strictly increasing and next ⌊k/2⌋ elements in array are strictly decreasing, (⌊k/2⌋+1)th element is maximum. When OJ came
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