Question: How do you return maximum value for the passed index within all 2d arrays in Java. For example: if idx = 6, it needs to
How do you return maximum value for the passed index within all 2d arrays in Java. For example: if idx = 6, it needs to return maximum of data[0][6], data[1][6], ...data[data.length - 1][6] if idx = 4, it needs to return maximum of data[0][4], data[1][4], ...data[data.length - 1][4] If an item at the given index does not exist in a specific sub-array you should ignore and continue with the remaining sub-arrays. If an item at the given index does not exist in ANY sub-array, you should return 0. I cannot use any inbuilt libraries or hardcode
public int maxForRound(int idx) { return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
