Equal is not higher.
transcript
Prices: four, four, five. Days until a strictly higher price? Day zero should say two. One small mistake says one instead. Let us find it.
The code pops while the top is lower or equal. Day zero waits on the stack. The second four arrives. It is equal, so day zero is popped. Day zero gets one. That is wrong. Four is not higher than four.
Pop only while the top is strictly lower. The second four does not pop day zero. Both fours wait, in order. Five arrives. It is higher than both. It pops both fours. Day zero gets two. Day one gets one.
Strictly higher needs less than. The same or higher needs less than or equal. The words in the problem decide.
Say what equal values do. Write the condition second. Test with two equal values.
Equal values are the usual trap. Decide the tie rule first. Then write the loop. Full breakdown in the lecture.