Hi!
I mostly use C and C++ to golf. Pretty bad at it.
My avatar is the format code of my first try at golfing, here.
My first iter, 115 bytes:
int f(int*a,int n){int m=0,l=0,i=0;for(;i<n;++i){m+=(a[i]>=100+l)?100+l:a[i];l=(100-a[i]>=0)?100-a[i]:0;}return m;}
And my last iter, 78 bytes (that's 37 bytes save!)
m,l,g;f(a,n)int*a;{m=l=0;for(g=100;n--;++a)m+=fmin(g+l,*a),l=*a<g?g-*a:0;m=m;}
-25 bytes save by to AZTECCO and -4 bytes save by ceilingcat