Skip to main content

Posts

Showing posts with the label Day 11: 2D Arrays Hackerrank Solution in Java

Day 11: 2D Arrays Hackerrank Solution Java

 Day 11: 2D Arrays Hackerrank Solution Java For Explanation Watch Video: Sample Input 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 0 2 4 4 0 0 0 0 2 0 0 0 0 1 2 4 0 Sample Output 19 Code: import  java.io.*; import  java.math.*; import  java.security.*; import  java.text.*; import  java.util.*; import  java.util.concurrent.*; import  java.util.regex.*; public   class  Solution {      private   static   final  Scanner scanner =  new  Scanner(System.in);      public   static   void  main(String[] args) {          int [][] arr =  new   int [ 6 ][ 6 ];          for  ( int  i =  0 ; i <  6 ; i++) {             String[] arrRowItems = scanner.nextLine().split( " " );             scanner.skip( "(\r\n|[\n\r\u2028\u2029\u0085])?" );              for  ( int  j =  0 ; j <  6 ; j++) {                  int  arrItem = Integer.parseInt(arrRowItems[j]);                 arr[i][j] = arrItem;             }         }          int  max = Integer.MIN_VALUE;          for ( int  i= 0 ;i<=