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.
This is good but it fails a few test cases because in some arrays with negative values, the largest sum of an hourglass is actually less than 0 (ex. -6 or -19).
Kind of overkill but you can initialize sum to be Int32.MinValue to be sure your sum will always be updated.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 11: 2D Arrays
You are viewing a single comment's thread. Return to all comments →
This is good but it fails a few test cases because in some arrays with negative values, the largest sum of an hourglass is actually less than 0 (ex. -6 or -19).
Kind of overkill but you can initialize sum to be Int32.MinValue to be sure your sum will always be updated.