Several weeks ago I was praticing on CodeSignal and came to this problem (See figure).
Given an array, return the largest sum of elements within any of such rotated 45 degree rectangle. Does anyone have any idea how to solve this problem?