GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.hackerrank.com — Java 2D Array | HackerRank We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies. You are given a 2D array. An hourglass in an array is a portion shaped like this:
For example, if we create an hourglass using the number 1 within an array full of zeros, it may look like this:
Actually, there are many hourglasses in the array above. The three leftmost hourglasses are the following:
The sum of an hourglass is the sum of all the numbers within it. The sum for the hourglasses above are 7, 4, and 2, respectively. In this problem you have to print the largest sum among all the hourglasses in the array. Input Format There will be exactly lines, each containing integers seperated by spaces. Each integer will be between and inclusive. Output Format Print the answer to this problem on a single line. Sample Input Sample Output Explanation The hourglass which has the largest sum is: Cookie support is required to access HackerRankSeems like cookies are disabled on this browser, please enable them to open this website |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |