#include <iostream>
#include <vector>
#include <algorithm>
int main() {
std::vector<int> arr = {1,3,2,4,5,7};
std::sort(arr.begin(),arr.end());
for(int i=0; i<arr.size()-1; i++){
if(arr[i+1]!=arr[i]+1){
return -1;
}
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: