c++ solution using set and vector<int>
\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& p) \n    {\n        set<vector<int>>s;\n        for(auto &it:p)\n     
```\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& p) \n    {\n        set<vector<int>>s;\n        for(auto &it:p)\n        {\n            s.insert(it);\n        }\n        vector<int>v;\n        for(int i=0;i<arr.size();i++)\n        {\n            v.push_back(arr[i]);\n            if(s.count(v))\n            {\n                v.clear();\n            }\n        }\n        return v.size()==0;\n    }\n};\n```
['C', 'Ordered Set', 'C++']