Facebook
From Edgy Parakeet, 5 Years ago, written in Plain Text.
This paste is a reply to Untitled from Scorching Pheasant - go back
Embed
Viewing differences between Untitled and Re: Untitled
// Complete the hourglassSum function below.
    
import java.util.Scanner;
public class HelloWorld{

     public 
static int hourglassSum(int[][] arr) {
     
     
void main(String []args){
        
        Scanner scan=new Scanner(System.in);
        
int[] s=new int[16];
     int j=0,sum=0;
     int extraI=0,extraJ=0;
     while(extraJ<=3)
      {
       extraI=0;
        while(extraI<=3)
         {
           for(j=extraJ;j              {
               
array=new int[10];
        
for(int i=extraI;i                {
                 sum=sum+arr[i][j];
               }
             }
             boolean flag=false;
            for(int counter=0;counter             {
                System.out.println("Inside Sum Loop!!!");
               s[k]=sum;
            }
            
            
           extraI++;
         }//end of extraI while
     extraJ++;
     }//end of extraJ while

   int max=s[0];
   for(int i=0;ii=0;ilength;i++)
      {\n         if(s[i]>max)\n                  {
            max=s[i];
          }
      
array[i]=scan.nextInt();
        
}
     return max;
    }//end of Method
}
}

Replies to Re: Untitled rss

Title Name Language When
Re: Re: Untitled Edgy Horse text 5 Years ago.