{"id":24056491,"url":"https://github.com/arjun1237/2d-array-ds","last_synced_at":"2025-09-12T21:46:38.575Z","repository":{"id":110874982,"uuid":"204839189","full_name":"arjun1237/2D-Array-DS","owner":"arjun1237","description":null,"archived":false,"fork":false,"pushed_at":"2019-08-28T03:27:07.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T05:01:27.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arjun1237.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-28T03:20:49.000Z","updated_at":"2019-08-28T03:27:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b4f84e0-1171-4ca6-bb4e-7d9b2eb32453","html_url":"https://github.com/arjun1237/2D-Array-DS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun1237%2F2D-Array-DS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun1237%2F2D-Array-DS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun1237%2F2D-Array-DS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arjun1237%2F2D-Array-DS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arjun1237","download_url":"https://codeload.github.com/arjun1237/2D-Array-DS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240849057,"owners_count":19867617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-09T05:00:55.824Z","updated_at":"2025-02-26T12:13:48.272Z","avatar_url":"https://github.com/arjun1237.png","language":"Python","readme":"# 2D-Array-DS\n\n\nGiven a  2D Array, :\n\n1 1 1 0 0 0 \n\n0 1 0 0 0 0 \n\n1 1 1 0 0 0 \n\n0 0 0 0 0 0 \n\n0 0 0 0 0 0 \n\n0 0 0 0 0 0 \n\nWe define an hourglass in  to be a subset of values with indices falling in this pattern in 's graphical representation:\n\na b c \n\n  d \n  \ne f g \n\nThere are  hourglasses in , and an hourglass sum is the sum of an hourglass' values. Calculate the hourglass sum for every hourglass in , then print the maximum hourglass sum.\n\nFor example, given the 2D array:\n\n-9 -9 -9  1 1 1 \n\n 0 -9  0  4 3 2\n \n-9 -9 -9  1 2 3\n\n 0  0  8  6 6 0\n \n 0  0  0 -2 0 0\n \n 0  0  1  2 4 0\n \nWe calculate the following  hourglass values:\n\n-63, -34, -9, 12, \n\n-10, 0, 28, 23, \n\n-27, -11, -2, 10, \n\n9, 17, 25, 18\n\nOur highest hourglass value is  from the hourglass:\n\n0 4 3\n\n  1\n  \n8 6 6\n\nNote: If you have already solved the Java domain's Java 2D Array challenge, you may wish to skip this challenge.\n\nFunction Description\n\nComplete the function hourglassSum in the editor below. It should return an integer, the maximum hourglass sum in the array.\n\nhourglassSum has the following parameter(s):\n\narr: an array of integers\nInput Format\n\nEach of the  lines of inputs  contains  space-separated integers .\n\nConstraints\n\nOutput Format\n\nPrint the largest (maximum) hourglass sum found in .\n\nSample Input\n\n1 1 1 0 0 0\n\n0 1 0 0 0 0\n\n1 1 1 0 0 0\n\n0 0 2 4 4 0\n\n0 0 0 2 0 0\n\n0 0 1 2 4 0\n\nSample Output\n\n19\n\nExplanation\n\n contains the following hourglasses:\n\nimage\n\nThe hourglass with the maximum sum () is:\n\n2 4 4\n  2\n1 2 4\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun1237%2F2d-array-ds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjun1237%2F2d-array-ds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjun1237%2F2d-array-ds/lists"}