You are viewing a single comment's thread. Return to all comments →
my solution for this Question:
def hourglassSum(arr): result=None n=len(arr)-2 for i in range(n): for j in range(n): hrglass_sum=arr[i][j]+arr[i][j+1]+arr[i][j+2]+arr[i+1][j+1]+arr[i+2][j]+arr[i+2][j+1]+arr[i+2][j+2] if result is None: result=hrglass_sum elif hrglass_sum>result: result=hrglass_sum return result
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
2D Array - DS
You are viewing a single comment's thread. Return to all comments →
my solution for this Question: