Last active
September 18, 2018 16:30
-
-
Save mochow13/9afd44ad68058151025b4c38f24b17c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<int> collection={6,5,3,2,1,4,6,7}; | |
std::vector<int> diffs; | |
std::adjacent_difference(begin(collection), end(collection), std::back_inserter(diffs)); | |
// The first element of diffs will be same as the first element of collection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment