Breadcrumbs hackerrank /0006_2D_Array_DS / test.cpp Latest commit Cannot retrieve latest commit at this time. HistoryHistory File metadata and controls Code Blame 24 lines (21 loc) · 374 Bytes Raw #include "utest.h" #include "util.h" #define main mainFn #include "main.cpp" const ...
We define an hourglass in to be a subset of values with indices falling in this pattern in 's graphical representation: a b c d e f g There are hourglasses in , and anhourglass sumis the sum of an hourglass' values. Calculate the hourglass sum for every hourglass in , then print th...
[i + 2][j + 1] + arr[i + 2][j + 2]; res = max(sum, res); } } return res; } int main() { vector<vector<int>> arr(6, vector<int>(6)); for (auto& r : arr) { for (auto& c : r) { cin >> c; } } auto res = solution(arr); cout << res << endl; ...