Check Array Formation Through Concatenation : C++ Solution
\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        vector<int> v(101,-1);\n        for(int i=0;i<piece
```\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        vector<int> v(101,-1);\n        for(int i=0;i<pieces.size();i++)\n            v[pieces[i][0]] = i;\n        for(int i=0;i<arr.size();){\n            int p = v[arr[i]], j=0;\n            if(p==-1)\n                return false;\n            while(j<pieces[p].size()){\n                if(arr[i++]!=pieces[p][j++])\n                    return false;\n            }\n        }\n        return true;\n    }\n};\n```
[]