Sir please help me in this

Hello @kumarpratikkant,
The problem here is with you entering elements to the list of elements. How can we use len() function to empty list a[]. And if you want to first enter the size of the list you need to typecast the input to integer.
And in this question we need to print the elements of streaming list and not provide list as input.
Here is the code to take input in the list:list
for this problem:problem

So look first the sum is 3 so it the element of that position is printed. Now the sum is 7 so 4 is printed but after entering -10 in the stream the sum becomes -3<0 so not printed.

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.