Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. public static int[] Func(int[][] arr, int m, int n)
  2.     {
  3.         int[] result = new int[0];
  4.         int min = arr[0][0];
  5.         int max = min;
  6.         int col=0;
  7.         int row=0;
  8.         for (int i = 0; i<m;i++)
  9.         {
  10.             for (int j = 0; j<m;j++)
  11.             {
  12.                 if (arr[i][j]<min)
  13.                     col=j;
  14.             }
  15.             for (int x = 0; x<m;x++)
  16.             {
  17.                 if (arr[x][col]>max)
  18.                     row=x;
  19.             }
  20.             if (i==row)
  21.             result=add(result, arr[row][col]);
  22.         }
  23.         return result;
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement