Temporary storing of sum?

in the function i think the sum is getting lost everytime after taking the modulo so how it is in continuation each time we add element from the array. Should the sum be stored temporarily?

@asaraf2407 can you please share the timestamp in the video or the code that you are referring to?

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.