I have implemented the code but didnt get that how to implement for individual iteration

@garganshul151 hey check out this implementation ,you will get it:

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.

please answer this question its been very long

@garganshul151 hey I have already corrected your code,please check that.