Prerequisite:
https://www.youtube.com/watch?v=ESVXW... Check this link for more detail explanation of this powerful algorithm: https://en.wikipedia.org/wiki/Prefix_sum Python for beginners: https://www.youtube.com/watch?v=egq7Z...
Code: l=eval(input()); i=1; output=[]; output.append(l[0]); prefixsum=l[0]; while(i<len(l)): prefixsum=prefixsum+l[i]; output.append(prefixsum); i=i+1; print(output)
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
https://www.facebook.com/groups/pirawenpython/
https://www.youtube.com/watch?v=ESVXW... Check this link for more detail explanation of this powerful algorithm: https://en.wikipedia.org/wiki/Prefix_sum Python for beginners: https://www.youtube.com/watch?v=egq7Z...
Code: l=eval(input()); i=1; output=[]; output.append(l[0]); prefixsum=l[0]; while(i<len(l)): prefixsum=prefixsum+l[i]; output.append(prefixsum); i=i+1; print(output)
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
https://www.facebook.com/groups/pirawenpython/
0 Comments:
Post a Comment