Sum of vector

PHOTO EMBED

Sun May 26 2024 00:22:35 GMT+0000 (Coordinated Universal Time)

Saved by @ayushg103 #c++

int sum = accumulated(v.begin(),v.end(),0);
content_copyCOPY

0 is the initial value of sum