What is the error

#include
#include
using namespace std;
int main() {
int n;
cin>>n;
int bul[100];
for(int i=0;i<n;i++)
{
cin>>bul[i];
}

int left[100];
int right[100];
left[0]=bul[0];
for(int i=1;i<n;i++)
{
    left[i]=max(left[i-1],bul[i]);
}
right[n-1]=bul[n-1];
for(int i=n-2;i>=0;i--)
{
    right[i]=max(bul[i-1],right[i]);
}
int total;
int sum=0;
for(int i=0;i<n;i++)
{
    total=(min(left[i],right[i]))-bul[i];
    sum=sum+total;
    
}
cout<<sum;
return 0;

@Bhavit_Singla Please save your code on ide.codingblocks.com and share its link.

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.