Struggling to understand how to loop this properly how do i


Struggling to understand how to loop this properly. How do I set up the initial arrays with "minimum length 1" and then loop through it?

Given an array of ints, minimum length 1, figure out which is larger between the first and last elements in the array, and set all the other elements to be that value. Return the changed array.

public int[] maxEnd(int[] a) {

}

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Struggling to understand how to loop this properly how do i
Reference No:- TGS02786396

Now Priced at $10 (50% Discount)

Recommended (94%)

Rated (4.6/5)