Partially Correct Answer for go code


#1

Why this code is wrong??

>     func perfectPeak(A []int )  (int) {
>         if len(A)<3{
>             return 0
>         }
>         leftMax := make([]int64, len(A))
>         leftMax[0] = int64(A[0])
>          min := int64(A[len(A)-1])
>         for i:= 1; i<len(A)-1;i++{
>             if int64(A[i])>leftMax[i-1]{
>                 leftMax[i]= int64(A[i])
>             }else{
>                 leftMax[i] = leftMax[i-1]
>             }
>         }
>        
>         for i:= len(A) -2; i>0;i--{
>             if int64(A[i])<min{
>                 min= int64(A[i])
>             }
>             
>             if int64(A[i]) >= leftMax[i] && int64(A[i])<=min{
>                 return 1
>             } 
>             
>         }
>         return 0
>     }