You are viewing a single comment's thread. Return to all comments →
In C#
public static int SearchArray(List<List<int>> arr) { int maxY = arr.Count - 1; int maxX = arr[0].Count - 1; int maxCount = -63; for(int curY = 1; curY < maxY; curY++) { for(int curX = 1; curX < maxX; curX++) { int curCount = arr[curY-1].GetRange(curX-1, 3).Sum(); curCount += arr[curY][curX]; curCount += arr[curY+1].GetRange(curX-1, 3).Sum(); maxCount = curCount > maxCount ? curCount : maxCount; } } return maxCount; }
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 →
In C#