Language: C

#include<stdio.h>

void Sub(int *Data,int n,int sub,int L,int R){
    for(int i = L; i <=R; i++)
    {
        Data[i]-=sub;
    }
    
}

int Min(int *Data,int n,int L,int R){
    int k=L;
    for(int i = L; i <=R; i++)
    {
        if(Data[i]<Data[k]) k=i;
    }
    return k;
}

void shower(int *Data,int n,int L,int R,int *ans){
    int k=Min(Data,n,L,R);
    Sub(Data,n,k,L,R);
    ans+=k;
    if(k==0){
        shower(Data,n-1,1,n-1,&ans);
    }else if(k==n-1){
        shower(Data,n-1,0,n-2,&ans);
    }else{
        shower(Data,k,1,k-1,&ans);
        shower(Data,,k+1,n-1,&ans);
    }
    
}


int main(void){
    int N=0;
    int ans=0;
    scanf("%d",&N);
    int h[N];
    
    for(int i = 0; i < N; i++){
        scanf("%d",&h[i]);
        MIN=Min(MIN,h[i]);
    }

    shower(h,N,0,n-1,&ans);
    
    printf("%d",ans);

    return 0;
}

Compiler output:
main.c: In function 'shower':
main.c:25:31: error: passing argument 5 of 'shower' from incompatible pointer type [-Wincompatible-pointer-types]
   25 |         shower(Data,n-1,1,n-1,&ans);
      |                               ^~~~
      |                               |
      |                               int **
main.c:20:46: note: expected 'int *' but argument is of type 'int **'
   20 | void shower(int *Data,int n,int L,int R,int *ans){
      |                                         ~~~~~^~~
main.c:27:31: error: passing argument 5 of 'shower' from incompatible pointer type [-Wincompatible-pointer-types]
   27 |         shower(Data,n-1,0,n-2,&ans);
      |                               ^~~~
      |                               |
      |                               int **
main.c:20:46: note: expected 'int *' but argument is of type 'int **'
   20 | void shower(int *Data,int n,int L,int R,int *ans){
      |                                         ~~~~~^~~
main.c:29:29: error: passing argument 5 of 'shower' from incompatible pointer type [-Wincompatible-pointer-types]
   29 |         shower(Data,k,1,k-1,&ans);
      |                             ^~~~
      |                             |
      |                             int **
main.c:20:46: note: expected 'int *' but argument is of type 'int **'
   20 | void shower(int *Data,int n,int L,int R,int *ans){
      |                                         ~~~~~^~~
main.c:30:21: error: expected expression before ',' token
   30 |         shower(Data,,k+1,n-1,&ans);
      |                     ^
main.c:30:9: error: too few arguments to function 'shower'
   30 |         shower(Data,,k+1,n-1,&ans);
      |         ^~~~~~
main.c:20:6: note: declared here
   20 | void shower(int *Data,int n,int L,int R,int *ans){
      |      ^~~~~~
main.c: In function 'main':
main.c:44:9: error: 'MIN' undeclared (first use in this function); did you mean 'Min'?
   44 |         MIN=Min(MIN,h[i]);
      |         ^~~
      |         Min
main.c:44:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:44:13: error: too few arguments to function 'Min'
   44 |         MIN=Min(MIN,h[i]);
      |             ^~~
main.c:11:5: note: declared here
   11 | int Min(int *Data,int n,int L,int R){
      |     ^~~
main.c:47:18: error: 'n' undeclared (first use in this function)
   47 |     shower(h,N,0,n-1,&ans);
      |                  ^