Stacks Pattern
CodeChefOpen on judge ↗
A was playing with N piles of cubic stones of same dimensions. Each pile could be increased or decreased by adding or removing stones to it. So, he decided to put them in such a order that the stones in ith pile is equal to the stones in (N+1-i)th, i.e., H[i] = H[N+1-i]. It is also said that the height of each pile indexed from 1 to N/2 are in single step increasing order and then from N/2 to N
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