C++ Easy solution using maps
\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        map<int,vector<int>> mp; \n        // map the 1st e
```\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        map<int,vector<int>> mp; \n        // map the 1st element in pieces[i] to pieces[i]\n        for(auto p:pieces) \n            mp[p[0]] = p;\n        vector<int> result;\n        for(auto a:arr) {\n            if(mp.find(a)!=mp.end()) \n                result.insert(result.end(),mp[a].begin(),mp[a].end());\n        }\n        return result ==arr;\n    }\n};\n```\n***Happy New Year :-)***
['C', 'C++']