C++ solution with map
\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        \n        map<int,vector<int>> m;\n        \n      
```\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        \n        map<int,vector<int>> m;\n        \n        for(auto p:pieces){\n            m[p[0]] = p;\n        }\n        vector<int> res;\n        \n        for(int num:arr)\n            if(m.count(num))\n                res.insert(res.end(),m[num].begin(),m[num].end());\n\n        return res == arr;\n        \n    }\n};\n```
[]