Java Easy to understand Solution -Max Min


#1

public class Solution {
public int solve(ArrayList A) {
Collections.sort(A);
int min=0;
int max=0;
int n=A.size()-1;

    min=A.get(0);
    max=A.get(n);
    
    return max+min;
}

}