Can you please explain me the approach to solve these type of problems…??
What should be my approach
Sorry for the delay, actually I had exams previously.
For the first three days just assign the value as it is, and then for the next day onwards take the minimum of the previous three days and add current day value. In the end, all you have to do is take the minimum of the last three days.
You can see my implementation.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.