← Unit 4 · all exercises
Saved in this browser only

The biggest in a row

Return the largest number in the row at the given position. Rows are counted from 0, and every row has at least one number.

int rowMax(int[][] grid, int row)

Solution.java
Loading editor…
Results

Examples

  • Solution.rowMax(new int[][]{{1, 9}, {3, 4}}, 0) → 9
  • Solution.rowMax(new int[][]{{1, 9}, {3, 4}}, 1) → 4

There are also 2 hidden tests you can't see. Solve the problem, not the examples.