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;
Test case 3 failed
push index of the price not the price in stack