Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilpropheta/89acd1a7168751699a45 to your computer and use it in GitHub Desktop.
Save ilpropheta/89acd1a7168751699a45 to your computer and use it in GitHub Desktop.
auto minDiff = inner_product(v.begin(), v.end()-1, v.begin()+1, numeric_limits<int>::max(),
[](int l, int r){ return min(l, r); }, // "sum"
[](int l, int r) { return r-l; } // "product"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment