C++ || Using set || Simple & concise solution
Please upvote if you liked my approach :)\n\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& p) \n    {\n        set<vec
**Please upvote if you liked my approach :)**\n```\nclass Solution {\npublic:\n    bool canFormArray(vector<int>& arr, vector<vector<int>>& p) \n    {\n        set<vector<int> > s;\n        \n        for(auto it:p)\n            s.insert(it);\n        \n        vector<int> v;\n        \n        for(auto a:arr)\n        {\n            v.push_back(a);\n            \n            if(s.count(v))\n                v.clear();\n        }\n        \n        return v.size() == 0;\n    }\n};\n```
['C', 'Ordered Set', 'C++']