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.
Day 11: 2D Arrays
Day 11: 2D Arrays
Sort by
recency
|
1942 Discussions
|
Please Login in order to post a comment
I have solved the problem in Python 3
`
hourglass_sums = []\n for i in range(4): for j in range(4): first_row = arr[i][j] + arr[i][j+1] + arr[i][j+2] second_row = arr[i+1][j+1] third_row = arr[i+2][j] + arr[i+2][j+1] + arr[i+2][j+2] sum = first_row + second_row + third_row hourglass_sums.append(sum) print(max(hourglass_sums))
Here is Day 11: 2D Arrays problem solution - https://programmingoneonone.com/hackerrank-day-11-2d-arrays-30-days-of-code-solution.html
Python3 Solution
import math import os import random import re import sys
if name == 'main':