Explaining the Problem , Logic and Solving Technique
I will recommend you to go on https://www.hackerrank.com/challenges/2d-array/problem then come to see the explanation .
Hourglass :- It’s a time measurement tool .
Problem says that there will be a matrix of 6 row and 6 column , all you have to do is to find the all possible hourglass structure possible , after finding the all hourglass you will add the elements belong to every hourglass separately and then you have to check which is have greatest value comparison to every hourglass structure .
Now using a loop you will loop a hourglass structured elements and return it as sum , in hackerRank problem they were finding who is greatest value on their own . Just you have to return the all possible hourglass sum one by one .
You can use two for loops , one for iterating row and another for iterating columns . Both will start from zero and goes till 3 , because in every row there could only be 4 possible hourglasses and in every column there could only be 4 possible hourglasses .