C++ SIMPLE EASY SOLUTION
\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        int n=arr.size();\n        unordered_map<int,int> m
```\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        int n=arr.size();\n        unordered_map<int,int> m;\n        for(int i=0;i<n;i++){\n            m[arr[i]]=i;\n        }\n        n=pieces.size();\n        for(int i=0;i<n;i++){\n            int nn=pieces[i].size();\n            for(int j=0;j<nn-1;j++){\n                int x=pieces[i][j];\n                int y=pieces[i][j+1];\n                if(m.count(x)==0 || m.count(y)==0)\n                    return false;\n                if(m[y]-m[x] != 1)\n                    return false;\n                m[x]=-1;\n            }\n            if(m.count(pieces[i][nn-1])==0)\n                    return false;\n            m[pieces[i][nn-1]]=-1;\n        }\n        for(auto x:m)\n            if(x.second!=-1)\n                return false;\n        return true;\n    }\n};\n```
[]