C++ Runtime 0ms
\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        \n        map<int,int>mp;\n        for(int i=0;i<ar
```\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& pieces) {\n        \n        map<int,int>mp;\n        for(int i=0;i<arr.size();i++)\n        {\n            mp.insert({arr[i],i});\n        }\n        for(int i=0;i<pieces.size();i++)\n        {\n            int index=0;\n            for(int j=0;j<pieces[i].size();j++)\n            {\n                if(mp.find(pieces[i][j])==mp.end())\n                    return false;\n                else\n                {\n                    if(j==0)\n                        index=mp[pieces[i][0]]+1;\n                    else if(mp[pieces[i][j]]==index)\n                        index=mp[pieces[i][j]]+1;\n                    else\n                        return false;\n                }\n            }\n        }\n        return true;\n        \n    }\n};\n```
[]