Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void array_set_to_list(const std::vector<std::list<int>> &src, std::list<int> &dst){
- for(int i = 0; i < src.size();i++){
- if(src[i].size() <= 4 && std::is_sorted(src[i].begin(),src[i].end())){
- std::list<int> temp;
- for(auto j:src[i]){
- temp.push_back(j);
- temp.reverse();
- }
- if(dst.empty()){
- dst.splice(dst.begin(),temp);
- temp.clear();
- }
- else{
- dst.merge(temp);
- temp.clear();
- }
- }
- }
- for(auto l:dst){
- cout << l <<' ';
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement