Calculate the sum

sir my code is having run time error. please tell me the reason.

hi @abhinavai21_5c95a2a2e1fb9fe8 your approach is wrong
refer u dont need to calculate the sum by shifting again and again, anyway u will be adding the array sum of that array only even if u shift and add as u r adding all the elements so dont shift just keep updating the sum of array

see here for implementation https://ide.codingblocks.com/s/657171 and do a dry run

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.