← All problemsSign in

Height

In a class of n students, each student is trying to find the partner who's height is greater than his own height and that partner should be immediate next to him in terms of position. Your task is to return an array which gives the next greater height(i.e. height of partner) for each student, who is closest to him in terms of position. In case you do not find a partner print -1. The case where the

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