@@ -0,0 +1,1142 @@
+package java_problems.data_structures;%0D%0A%0D%0Aimport java.util.Scanner;%0D%0A%0D%0Apublic class TwoDimensionalArray %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A        Scanner sc = new Scanner(System.in);%0D%0A        int%5B%5D%5B%5D array = new int%5B6%5D%5B6%5D;%0D%0A        for (int row = 0; row %3C 6; row++) %7B%0D%0A%09%09%09for (int column = 0; column %3C 6; column++) %7B%0D%0A%09%09%09%09array%5Brow%5D%5Bcolumn%5D = sc.nextInt();%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A        int largest = Integer.MIN_VALUE;%0D%0A        for (int row = 0; row %3C 4; row++) %7B%0D%0A            for (int column = 0; column %3C 4; column++) %7B%0D%0A                int total = hourglassSum(array, row, column);%0D%0A                largest = Math.max(largest, total);%0D%0A            %7D%0D%0A        %7D%0D%0A        System.out.println(largest);%0D%0A    %7D%0D%0A    %0D%0A    public static int hourglassSum(int%5B%5D%5B%5D nums, int r, int c) %7B%0D%0A        int sum = 0;%0D%0A        for (int row = r; row %3C r + 3; row++) %7B%0D%0A            if (row == r + 1) %7B%0D%0A                sum += nums%5Brow%5D%5Bc + 1%5D;%0D%0A            %7D else %7B%0D%0A                for (int column = c; column %3C c + 3; column++) %7B%0D%0A                    sum += nums%5Brow%5D%5Bcolumn%5D;%0D%0A                %7D%0D%0A            %7D%0D%0A        %7D%0D%0A        return sum;%0D%0A    %7D%0D%0A%7D

Add TwoDimensionalArray