# Hackrank - 2D-array

Thought:

• Had to understand how to iterate a 2D array. Shame on me that I don’t know this before. So, basically 2D array is like arr = [[1,0,1], [2,1,2], [2,1,3]]. So, its rows = arr.length and cols = arr[0].length.
• Another thing is to determine the condition of forloop. Use i+2 < rows and j+2 < cols.

Example

The hourglass sums are:

The highest hourglass sum is from the hourglass beginning at row , column :