Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. private static int checkMatrix(int[][] matrix) {
  2.     int maxNegativeColumn = -1;
  3.     columns:
  4.         for (int j = matrix[0].length-1; j >= 0; j--) {
  5.             for (int i = 0; i < matrix.length;i++){
  6.                 if (matrix[i][j] >= 0){
  7.                     continue columns;
  8.                 }
  9.             }
  10.             maxNegativeColumn = j;
  11.     }
  12.     return maxNegativeColumn;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement