Stock problem doubt

in line 19 why we pushed curday
i am not getting exactly
what actually we are passing into stack

Hello @yatin,

Observe the follwing picture:
image

We are comparing the price of current day with the price at previous day.
So, when you pushed curday in line 19.
You are actually pushing the previous day for the next iteration.
This is done to make the above mentioned comparisons.

Hope, this would help.
Give a like, if you are satisfied.

1 Like

got sir thank you :slight_smile: