Simple code in java


#1
`public class Solution {
public int solve(int[] A) {
    int max = A[0],min=A[0];
    
    for(int i=1;i<A.length;i++)
    {
        if(A[i]<min)
        min=A[i];
        
        if(A[i]>max)
        max=A[i];
    }
    
    return max+min;
}

}
`