code: public static int min(int[][] matrix) {
      int min = Integer.MAX_VALUE;
      for (int[] row : matrix) {
        for (int elem : row) {
          min = Math.min(min, elem);
        }
      }
      return min;
    }
docs: Returns the smallest element of the matrix