Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created February 12, 2018 09:08
Show Gist options
  • Save deque-blog/0da81e844c0c5ecab8d23e2fbb287aa1 to your computer and use it in GitHub Desktop.
Save deque-blog/0da81e844c0c5ecab8d23e2fbb287aa1 to your computer and use it in GitHub Desktop.
int best_quadrant(Matrix const& m)
{
int n = m.size() / 2;
int sum = 0;
for (int i : range(0, n))
{
for (int j : range(0, n))
{
auto flips = symetric_values(m, n, {i, j});
sum += *std::max_element(flips.begin(), flips.end());
}
}
return sum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment