Test case 3 failed

int[] a = new int[prices.length];
stack.push(prices[0]);
a[0] = 1;
for (int i = 1; i < prices.length; i++) {
if (prices[i] < stack.top()) {
while (!stack.isEmpty()) {
stack.pop();
}
}
stack.push(prices[i]);
a[i] = stack.size();
}
return a;

push index of the price not the price in stack